Created
March 23, 2012 21:39
-
-
Save moneill/2175337 to your computer and use it in GitHub Desktop.
Moar movies
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
require 'spec_helper' | |
describe MoviesController do | |
before :each do | |
@movie = Movie.create(:title => 'American Graffiti', :rating => 'R', :release_date => "1973-08-11", :director => "George Lucas") | |
end | |
describe 'Find similar movies' do | |
it "has a route defined to show similar movies" do | |
get 'similar', {:id => @movie.id} | |
end | |
it "should redirect to the movie index when no similar movies exist" do | |
Movie.should_receive('find_similar').with(@movie.id).and_return(nil) | |
get 'similar', {:id => @movie.id} | |
response.should redirect_to(movies_path) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment