Sha256: 57e6365bc988b4787d1fd24f380dd37b8291e78a4ed4a7834db25673c8416bce

Contents?: true

Size: 857 Bytes

Versions: 1

Compression:

Stored size: 857 Bytes

Contents

require_relative '../test_helper'

#TODO: rewrite tests using Minitest best practices ()

describe "TMDB::Search" do
  # Create a 'test/api_key' file and paste in your API key to run the tests
  # TODO: Work in 'gem webmock' for offline testing, review: http://code.tutsplus.com/articles/writing-an-api-wrapper-in-ruby-with-tdd--net-23875
  API_KEY = File.open('test/api_key').read

  let(:search) { TMDB::Search.new(API_KEY) }

  # TMDB::Search#movie_search(query, page)

  it "tmdb.movie_search('matrix') should return a page of matrix results" do 
    puts search
    movies = search.movie_search(query: 'matrix')
    movies.first['title'].must_equal "The Matrix"
  end

  # TMDB::Search#movie(movie_id)

  it "tmdb.movie('550') should return the movie Fight Club" do
    movie = search.movie('550')
    movie['title'].must_equal "Fight Club"
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tmdb-0.1.0 test/tmdb/test_search.rb