Skip to content
Browse files

added error checking

  • Loading branch information...
1 parent 03c7866 commit d6c1028153bd83db2c9719e1a8a81569c9409fee @maddox committed Jan 5, 2009
Showing with 15 additions and 1 deletion.
  1. +15 −1 movieposterdb_spec.rb
View
16 movieposterdb_spec.rb
@@ -12,14 +12,28 @@
describe "when searching via imdb id" do
before do
@result = @mpdb.find_by_imdb_id("tt0421715", 300)
- puts @result.inspect
end
it "should return the movie poster" do
@result["imageurl"].should_not be_nil
end
end
+
+ describe "when searching via imdb id and id is bad" do
+ before do
+ @result = @mpdb.find_by_imdb_id("tt04217d15", 300)
+ end
+
+ it "should not have the movie poster" do
+ @result["imageurl"].should be_nil
+ end
+
+ it "should have an error" do
+ @result["errors"].should_not be_nil
+ end
+
+ end
end

0 comments on commit d6c1028

Please sign in to comment.
Something went wrong with that request. Please try again.