Cookin' with Ruby on Rails - More Designing for Testability
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
CB: Excellent, Paul. Let's see whatcha got.

Figure 35
CB: Looks great! Let's run the test case and see what we get.
ruby test\functional\recipe_controller_test.rb

Figure 36
CB: Well now. I'd say that's a pretty good session's worth of work. What do you think, Paul?
Paul: As much as I'd like to jump in on the Integration tests, I do need to run. Got another meeting with some customers to review test plans.
CB: You know, I was thinking that maybe we should bring Boss into the session to work on the Integration tests. That's where I'm really hoping to engage with him, and it'd give you a good chance to see how this might work into the test planning model. What do you think?
Paul: I think that could be real interesting. Let me get with Boss and see when he can break free to join us. I'll do my best to bring him along next time. See ya, bud.
Articles in this series
- Cookin' with Ruby on Rails - Designing for Testability by Bill Walton
- Cookin' with Ruby on Rails - May by Bill Walton
- Rolling with Ruby on Rails Revisited by Bill Walton and Curt Hibbs
Bill Walton is a software development/project management consultant/contractor.
Return to Ruby.
Showing messages 1 through 2 of 2.
-
problem with assert_redirected_to
2008-01-17 08:26:14 geekzoid [View]
-
practice efficient code
2007-08-07 04:56:03 IbrahimAhmed [View]
Is there a real need to use a find(:all), an each loop, then invoke a destroy method for each instance just to delete all records in a table, I know it is just a test code but people are getting used easily to this inefficient code.
I notice that you repeated the same technique more than once in your tutorial.
Wouldn't be more efficient to use...
Recipe.delete_all
instead of...
def setup
recipes = Recipe.find(:all)
recipes.each do |this_recipe|
this_recipe.destroy
end
end










"assert_redirected_to :action => 'new' as in the example i get the following error
"can't convert hash to string".
im new to ruby and rails so i was wondering if anyone could shed some light on y it isnt working for me. thanks