Sha256: 0250fd75c37d26d051afc16eaf574ed9375c895320fd005f48081e26263c9cd0

Contents?: true

Size: 1.75 KB

Versions: 70

Compression:

Stored size: 1.75 KB

Contents

require 'spec_helper'

describe FbGraph::Connections::Members do
  let :member do
    FbGraph::User.new('member_id')
  end

  context 'when included in FbGraph::Group' do
    describe '#members' do
      it 'should return members as FbGraph::User' do
        mock_graph :get, 'emacs/members', 'groups/members/emacs_private', :access_token => 'access_token' do
          users = FbGraph::Group.new('emacs', :access_token => 'access_token').members
          users.each do |user|
            user.should be_instance_of FbGraph::User
          end
        end
      end
    end

    describe '#member!' do
      it :NOT_SUPPORTED_YET
    end

    describe '#unmember!' do
      it :NOT_SUPPORTED_YET
    end
  end

  context 'when included in FbGraph::FriendList' do
    describe '#members' do
      it 'should return members as FbGraph::User' do
        mock_graph :get, 'list_id/members', 'friend_lists/members/sample', :access_token => 'access_token' do
          users = FbGraph::FriendList.new('list_id', :access_token => 'access_token').members
          users.each do |user|
            user.should be_instance_of FbGraph::User
          end
        end
      end
    end

    describe '#member!' do
      it 'should return true' do
        mock_graph :post, 'list_id/members/member_id', 'true', :access_token => 'access_token' do
          FbGraph::FriendList.new('list_id', :access_token => 'access_token').member!(member).should be_true
        end
      end
    end

    describe '#unmember!' do
      it 'should return true' do
        mock_graph :delete, 'list_id/members/member_id', 'true', :access_token => 'access_token' do
          FbGraph::FriendList.new('list_id', :access_token => 'access_token').unmember!(member).should be_true
        end
      end
    end
  end
end

Version data entries

70 entries across 70 versions & 1 rubygems

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