[rspec-devel] If you set an expectation on something that's already stubbed, should it return the stubbed value?

Craig Demyanovich cdemyanovich at gmail.com
Sat Sep 13 16:52:53 EDT 2008


In an earlier message, you wrote:

it "should find the book" do
 get :show, :id => "1"


it "should assign the book to the view" do
 get :show, :id => "1"
 assigns[:book].should == @mock_book

Now we've got one example that says we should find the proper book, and
another one that says we should assign it to the view.  And with these
two, we can be confident everything is set up properly because there'd
be no way for @mock_book to make it to the view were it not the same
object returned by Book.find.

Where does @mock_book come from? A before block?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-devel/attachments/20080913/f2af31e6/attachment.html>

More information about the rspec-devel mailing list