Permalink
Browse files

Test for handling nils in get_picture

  • Loading branch information...
1 parent 8c6cee6 commit d91b358d9524618564035662ad1b95a4a9da640e @arsduo committed Jan 25, 2013
Showing with 12 additions and 5 deletions.
  1. +12 −5 spec/support/graph_api_shared_examples.rb
@@ -85,12 +85,19 @@
results.should have(2).items
end
- it "can access a user's picture" do
- @api.get_picture(KoalaTest.user2).should =~ /http[s]*\:\/\//
- end
+ describe "#get_picture" do
+ it "can access a user's picture" do
+ @api.get_picture(KoalaTest.user2).should =~ /http[s]*\:\/\//
+ end
- it "can access a user's picture, given a picture type" do
- @api.get_picture(KoalaTest.user2, {:type => 'large'}).should =~ /^http[s]*\:\/\//
+ it "can access a user's picture, given a picture type" do
+ @api.get_picture(KoalaTest.user2, {:type => 'large'}).should =~ /^http[s]*\:\/\//
+ end
+
+ it "works even if Facebook returns nil" do
+ @api.stub(:graph_call).and_return(nil)
+ @api.get_picture(KoalaTest.user2, {:type => 'large'}).should be_nil
+ end
end
it "can access connections from public Pages" do

0 comments on commit d91b358

Please sign in to comment.