Skip to content
This repository
Browse code

Test for handling nils in get_picture

  • Loading branch information...
commit d91b358d9524618564035662ad1b95a4a9da640e 1 parent 8c6cee6
Alex Koppel authored January 25, 2013

Showing 1 changed file with 12 additions and 5 deletions. Show diff stats Hide diff stats

  1. 17  spec/support/graph_api_shared_examples.rb
17  spec/support/graph_api_shared_examples.rb
@@ -85,12 +85,19 @@
85 85
     results.should have(2).items
86 86
   end
87 87
 
88  
-  it "can access a user's picture" do
89  
-    @api.get_picture(KoalaTest.user2).should =~ /http[s]*\:\/\//
90  
-  end
  88
+  describe "#get_picture" do
  89
+    it "can access a user's picture" do
  90
+      @api.get_picture(KoalaTest.user2).should =~ /http[s]*\:\/\//
  91
+    end
91 92
 
92  
-  it "can access a user's picture, given a picture type"  do
93  
-    @api.get_picture(KoalaTest.user2, {:type => 'large'}).should =~ /^http[s]*\:\/\//
  93
+    it "can access a user's picture, given a picture type"  do
  94
+      @api.get_picture(KoalaTest.user2, {:type => 'large'}).should =~ /^http[s]*\:\/\//
  95
+    end
  96
+
  97
+    it "works even if Facebook returns nil" do
  98
+      @api.stub(:graph_call).and_return(nil)
  99
+      @api.get_picture(KoalaTest.user2, {:type => 'large'}).should be_nil
  100
+    end
94 101
   end
95 102
 
96 103
   it "can access connections from public Pages" do

0 notes on commit d91b358

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