search for: mock_foo

Displaying 2 results from an estimated 2 matches for "mock_foo".

2007 Dec 13
8
stub with assigns?
is there a way to stub a method that sets an instance variable, so the stub sets it too? def find_foo @foo = Foo.find(params[:id] end ... controller.stub!(:find_foo).and_assigns(:foo, "123") -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20071213/2042719f/attachment.html
2007 Oct 19
27
Assumption tests
Hi all, I''ve been thinking about the whole validator/relationship speccing issue, and I came up with a suggestion, which I''d love to get some feedback on. The full article is available at http://www.inter-sections.net/ 2007/10/19/what-to-test-and-specify-and-where-to-do-it/ , with the relevant bit being about halfway down, but here''s the gist of it: 1.