Created
March 23, 2012 23:33
-
-
Save moneill/2176375 to your computer and use it in GitHub Desktop.
Redir with mock, boo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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