saasbook

movie_spec.2.rb

Aug 16th, 2013
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.46 KB | None | 0 0
  1. require 'spec_helper'
  2.  
  3. describe Movie do
  4.   describe 'searching Tmdb by keyword' do
  5.     it 'should call Tmdb with title keywords given valid API key' do
  6.       TmdbMovie.should_receive(:find).
  7.         with(hash_including :title => 'Inception')
  8.       Movie.find_in_tmdb('Inception')
  9.     end
  10.     it 'should raise an InvalidKeyError with no API key' do
  11.       lambda { Movie.find_in_tmdb('Inception') }.
  12.         should raise_error(Movie::InvalidKeyError)
  13.     end
  14.   end
  15. end
Add Comment
Please, Sign In to add comment