Sha256: 63a7d4ed439a66f562882146bbe4b4ddf3401e237cba14c4258ee631359ca08a

Contents?: true

Size: 907 Bytes

Versions: 75

Compression:

Stored size: 907 Bytes

Contents

require 'spec_helper'

describe FbGraph::Connections::MutualFriends do
  let(:me) { FbGraph::User.me('access_token') }

  shared_examples_for :fetch_mutual_friends_between_me_and_friend do
    it 'should return an Array of FbGraph::User' do
      mock_graph :get, 'me/mutualfriends/agektmr', 'users/mutual_friends/me_and_agektmr', :access_token => 'access_token' do
        friends = me.mutual_friends(friend)
        friends.each do |friend|
          friend.should be_instance_of FbGraph::User
        end
      end
    end
  end

  describe '#mutual_friends' do
    context 'when friend is a FbGraph::User' do
      let(:friend) { FbGraph::User.new('agektmr') }
      it_behaves_like :fetch_mutual_friends_between_me_and_friend
    end

    context 'when friend is just an identifier' do
      let(:friend) { 'agektmr' }
      it_behaves_like :fetch_mutual_friends_between_me_and_friend
    end
  end
end

Version data entries

75 entries across 75 versions & 1 rubygems

Version Path
fb_graph-2.7.17 spec/fb_graph/connections/mutual_friends_spec.rb
fb_graph-2.7.16 spec/fb_graph/connections/mutual_friends_spec.rb
fb_graph-2.7.15 spec/fb_graph/connections/mutual_friends_spec.rb
fb_graph-2.7.14 spec/fb_graph/connections/mutual_friends_spec.rb
fb_graph-2.7.13 spec/fb_graph/connections/mutual_friends_spec.rb
fb_graph-2.7.12 spec/fb_graph/connections/mutual_friends_spec.rb
fb_graph-2.7.11 spec/fb_graph/connections/mutual_friends_spec.rb
fb_graph-2.7.10 spec/fb_graph/connections/mutual_friends_spec.rb
fb_graph-2.7.9 spec/fb_graph/connections/mutual_friends_spec.rb
fb_graph-2.7.8 spec/fb_graph/connections/mutual_friends_spec.rb
fb_graph-2.7.7 spec/fb_graph/connections/mutual_friends_spec.rb
fb_graph-2.7.6 spec/fb_graph/connections/mutual_friends_spec.rb
fb_graph-2.7.5 spec/fb_graph/connections/mutual_friends_spec.rb
fb_graph-2.7.4 spec/fb_graph/connections/mutual_friends_spec.rb
fb_graph-2.7.3 spec/fb_graph/connections/mutual_friends_spec.rb
fb_graph-2.7.2 spec/fb_graph/connections/mutual_friends_spec.rb
fb_graph-2.7.1 spec/fb_graph/connections/mutual_friends_spec.rb
fb_graph-2.7.0 spec/fb_graph/connections/mutual_friends_spec.rb
fb_graph-2.6.7 spec/fb_graph/connections/mutual_friends_spec.rb
fb_graph-2.6.6 spec/fb_graph/connections/mutual_friends_spec.rb