Skip to content

Commit

Permalink
Changed movies_controller_spec to use actual mocks when checking
Browse files Browse the repository at this point in the history
assigns(), and to stub the Movie.find_in_tmdb method
  • Loading branch information
armandofox committed Sep 30, 2011
1 parent 041c58d commit 9b3e37e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spec/controllers/movies_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
response.should render_template('search_tmdb')
end
it 'should make the TMDb search results available to that template' do
fake_results = [mock_model('Movie'), mock_model('Movie')]
Movie.stub(:find_in_tmdb).and_return(fake_results)
post :search_tmdb, :search_string => 'hardware'
assigns(:movies).should == 'matching movies'
assigns(:movies).should == fake_results
end
end
end

0 comments on commit 9b3e37e

Please sign in to comment.