saasbook

movie_spec.2.rb

Mar 1st, 2014
395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.43 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.       Tmdb::Movie.should_receive(:find).with('Inception')
  7.       Movie.find_in_tmdb('Inception')
  8.     end
  9.     it 'should raise an InvalidKeyError with invalid API key' do
  10.       lambda { Movie.find_in_tmdb('Inception') }.
  11.         should raise_error(Movie::InvalidKeyError)
  12.     end
  13.   end
  14. end
Add Comment
Please, Sign In to add comment