saasbook

movies_controller_spec.5.rb

Jan 10th, 2012
523
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.70 KB | None | 0 0
  1. require 'spec_helper'
  2.  
  3. describe MoviesController do
  4.   describe 'searching TMDb' do
  5.     before :each do
  6.       @fake_results = [mock('Movie'), mock('Movie')]
  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.     it 'should select the Search Results template for rendering' do
  14.       Movie.stub(:find_in_tmdb).and_return(@fake_results)
  15.       post :search_tmdb, {:search_terms => 'hardware'}
  16.       response.should render_template('search_tmdb')
  17.     end
  18.     it 'should make the TMDb search results available to that template'
  19.   end
  20. end
Add Comment
Please, Sign In to add comment