> 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
This 'get' statement makes a request and gets the response. All the other methods know about that response. The details are hidden away... > 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? > How in the world do the assert statements know of the HTML that was > generated? See here for more... http://guides.rubyonrails.org/testing.html -- 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.

