Carl Jenkins wrote: > Thanks for the responses! > > So to me it seems like Ruby/Rails controllers know about the model; > since Rails "stitches" the view, controllers and model together for you > I guess that makes sense. > > A similar thing that is throwing me for a loop is something like this. > > test "should get index" do > get :index > assert_response :success > assert_select '#columns #side a' , :minimum => 4 > assert_select '#main .entry' , 3 > assert_select 'h3' , 'Programming Ruby 1.9' > assert_select '.price' , /\$[,\d]+\.\d\d/ > end > > This is a unit test from the book. The assert_select(s) test the html > response. But, this really confuses me because I see now response > anywhere?
What would you expect to see that you're not seeing? Why is this confusing you? > How in the world do the assert statements know of the HTML that was > generated? Why not look at the Test::Unit source code to find out? (BTW, I recommend switching from Test::Unit to RSpec as soon as possible.) Best, -- Marnen Laibow-Koser http://www.marnen.org [email protected] -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

