Advertisement
saasbook

movies_controller_spec.4.rb

Jan 10th, 2012
682
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.72 KB | None | 0 0
  1. require 'spec_helper'
  2.  
  3. describe MoviesController do
  4.   describe 'searching TMDb' do
  5.     it 'should call the model method that performs TMDb search' do
  6.       fake_results = [mock('Movie'), mock('Movie')]
  7.       Movie.should_receive(:find_in_tmdb).with('hardware').
  8.         and_return(fake_results)
  9.       post :search_tmdb, {:search_terms => 'hardware'}
  10.     end
  11.     it 'should select the Search Results template for rendering' do
  12.       fake_results = [mock('Movie'), mock('Movie')]
  13.       Movie.stub(:find_in_tmdb).and_return(fake_results)
  14.       post :search_tmdb, {:search_terms => 'hardware'}
  15.       response.should render_template('search_tmdb')
  16.     end
  17.     it 'should make the TMDb search results available to that template'
  18.   end
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement