Skip to content

Instantly share code, notes, and snippets.

@moneill
Created March 23, 2012 21:39
Show Gist options
  • Save moneill/2175337 to your computer and use it in GitHub Desktop.
Save moneill/2175337 to your computer and use it in GitHub Desktop.
Moar movies
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