test/unit/tmdb_movie_test.rb in ruby-tmdb3-0.3.3 vs test/unit/tmdb_movie_test.rb in ruby-tmdb3-0.3.4
- old
+ new
@@ -58,10 +58,15 @@
assert_kind_of Array, movies
movies.each do |movie|
assert_kind_of OpenStruct, movie
end
end
+
+ test "find by title with year should return movies from only that year" do
+ movie = TmdbMovie.find(:title => "Iron Man", :year => "2010", :expand_results => false)
+ assert_equal movie.id, 10138
+ end
test "find by title with limit=1 should return a single movie" do
assert_kind_of OpenStruct, TmdbMovie.find(:title => "Iron Man", :limit => 1)
end
@@ -107,9 +112,10 @@
test "TmdbMovie.new should raise error if supplied with raw data for movie that doesn't exist" do
Tmdb.expects(:api_call).with("movie", {:id => 999999999999}, nil).returns(nil)
Tmdb.expects(:api_call).with("movie/images", {:id => 999999999999}, nil).returns(nil)
Tmdb.expects(:api_call).with("movie/releases", {:id => 999999999999}, nil).returns(nil)
Tmdb.expects(:api_call).with("movie/casts", {:id => 999999999999}, nil).returns(nil)
+ Tmdb.expects(:api_call).with("movie/trailers", {:id => 999999999999}, nil).returns(nil)
assert_raise ArgumentError do
TmdbMovie.new({"id" => 999999999999}, true)
end
end