document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. require \'spec_helper\'
  2.  
  3. describe MoviesController do
  4.   describe \'searching TMDb\' do
  5.     before :each do
  6.       @fake_results = [mock(\'movie1\'), mock(\'movie2\')]
  7.     end
  8.     it \'should call the model method that performs TMDb search\' do
  9.       Movie.should_receive(:find_in_tmdb).with(\'hardware\').
  10.         and_return(@fake_results)
  11.       post :search_tmdb, {:search_terms => \'hardware\'}
  12.     end
  13.     describe \'after valid search\' do
  14.       before :each do
  15.         Movie.stub(:find_in_tmdb).and_return(@fake_results)
  16.         post :search_tmdb, {:search_terms => \'hardware\'}
  17.       end
  18.       it \'should select the Search Results template for rendering\' do
  19.         response.should render_template(\'search_tmdb\')
  20.       end
  21.       it \'should make the TMDb search results available to that template\' do
  22.         assigns(:movies).should == @fake_results
  23.       end
  24.     end
  25.   end
  26. end
');