Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'spec_helper'
- describe MoviesController do
- describe 'searching TMDb' do
- before :each do
- @fake_results = [mock('Movie'), mock('Movie')]
- end
- it 'should call the model method that performs TMDb search' do
- Movie.should_receive(:find_in_tmdb).with('hardware').
- and_return(@fake_results)
- post :search_tmdb, {:search_terms => 'hardware'}
- end
- describe 'after valid search' do
- before :each do
- Movie.stub(:find_in_tmdb).and_return(@fake_results)
- post :search_tmdb, {:search_terms => 'hardware'}
- end
- it 'should select the Search Results template for rendering' do
- response.should render_template('search_tmdb')
- end
- it 'should make the TMDb search results available to that template' do
- assigns(:movies).should == @fake_results
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement