search for: mock_review

Displaying 1 result from an estimated 1 matches for "mock_review".

Did you mean: mock_reviews
2007 Jun 01
0
rspec_on_rails, could someone provide an example of using mocks/stubs?
...ng when there are reviews" do end end I know I''m supposed to implement the specs first but I wrote the update_attribute() method here to show the kinds of method calls it would be making. Here''s what I think I need to do: - stub @book.reviews to return a mock object e.g. mock_reviews - stub mock_reviews.each to return another mock e.g. mock_r - stub mock_r.rating to return some value am I on the right track? it seems like a lot of preparation for such a simple test. Is there a better way? thanks dave -- View this message in context: http://www.nabble.com/rspec_on_rails%2C-c...