Don't like ads? PRO users don't see any ads ;-)

movie_spec.2.rb

By: saasbook on May 1st, 2012  |  syntax: Ruby  |  size: 0.46 KB  |  hits: 372  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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