Skip to content

Instantly share code, notes, and snippets.

@moneill
Created March 23, 2012 23:33
Show Gist options
  • Save moneill/2176375 to your computer and use it in GitHub Desktop.
Save moneill/2176375 to your computer and use it in GitHub Desktop.
Redir with mock, boo
it "should redirect to the movie index when no similar movies exist" do
@movie = mock('Movie')
@movie.stub(:id).and_return(1)
Movie.should_receive('find_similar').with(@movie.id).and_return(nil)
get 'similar', {:id => @movie.id}
response.should redirect_to(movies_path)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment