[rspec-users] Documentation about the returns method

Fernando Perez lists at ruby-forum.com
Wed Jan 14 16:51:54 EST 2009


>From the railscasts website source code, in the episodes_controller_spec
I read:

  it "index action with search should search published episodes" do
    get :index, :search => 'foo'

Here are my questions:
- What does the returns(Episode.all) mean?
- Is it stubbing what the search_published method returns?
- Is it useful to add the returns(Episode.all) method call here?
- Whats the difference with and_return(Episode.all)?
- Shouldn't we only test for:
Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list