spec/people/facebook_spec.rb in social_profile-0.2.2 vs spec/people/facebook_spec.rb in social_profile-0.3.0
- old
+ new
@@ -26,36 +26,36 @@
it "should response to followers_count" do
stub_request(:get, "https://graph.facebook.com/me/subscribers?access_token=abc&limit=1").
to_return(:status => 200, :body => fixture("facebook/followers.json"))
- @user.followers_count.should == 14
+ @user.followers_count.should == 0
end
it "should response to followers without limits (without fetch_all)" do
stub_request(:get, "https://graph.facebook.com/me/subscribers?access_token=abc&limit=5000").
to_return(:status => 200, :body => fixture("facebook/followers.json"))
- @user.followers.size.should == 13
+ @user.followers.size.should == 0
end
it "should response to followers without limits (with fetch_all)" do
stub_request(:get, "https://graph.facebook.com/me/subscribers?access_token=abc&limit=5000").
to_return(:status => 200, :body => fixture("facebook/followers.json"))
- @user.followers(:fetch_all => true).size.should == 13
+ @user.followers(:fetch_all => true).size.should == 0
end
it "should response to followers list with limits" do
stub_request(:get, "https://graph.facebook.com/me/subscribers?access_token=abc&limit=5").
to_return(:status => 200, :body => fixture("facebook/followers_5_0.json"))
stub_request(:get, "https://graph.facebook.com/me/subscribers?access_token=abc&after=MTE5ODU0NDEzNQ==&limit=5").
to_return(:status => 200, :body => fixture("facebook/followers_5_10.json"))
stub_request(:get, "https://graph.facebook.com/me/subscribers?access_token=abc&after=MTAwMDA0NDI3NDY3NjIx&limit=5").
to_return(:status => 200, :body => fixture("facebook/followers_5_15.json"))
- @user.followers(:limit => 5, :fetch_all => true).size.should == 13
+ @user.followers(:limit => 5, :fetch_all => true).size.should == 0
end
it "should response to first_post_exists?" do
_sql = SocialProfile::People::Facebook::FIRST_POST_FQL.gsub('{date}', '1293832800')
@@ -117,8 +117,17 @@
friends = @user.friends(:limit => 100000)
friends.should be_a(Array)
friends.size.should == 4343
+ end
+
+ it "should get mutual friends" do
+ mock_fql SocialProfile::People::Facebook::MUTUAL_FRIENDS, SocialProfile.root_path.join('spec/mock_json/facebook/mutual_friends.json'), :access_token => "abc" do
+ mutual_friends = @user.mutual_friends
+
+ mutual_friends.should be_a(Hash)
+ mutual_friends.size.should == 251
+ end
end
end
end