Sha256: a91d4bff0c80463d159272bc55d385ca3b5e5fcb9c6e7656a45c890101892894
Contents?: true
Size: 1.84 KB
Versions: 104
Compression:
Stored size: 1.84 KB
Contents
require 'spec_helper' describe FbGraph::Connections::Friends, '#friends' do context 'when included by FbGraph::User' do context 'when no access_token given' do it 'should raise FbGraph::Unauthorized' do mock_graph :get, 'arjun/friends', 'users/friends/arjun_public', :status => [401, 'Unauthorized'] do lambda do FbGraph::User.new('arjun').friends end.should raise_exception(FbGraph::Unauthorized) end end end context 'when identifier is not me' do it 'should raise FbGraph::Unauthorized' do mock_graph :get, 'arjun/friends', 'users/friends/arjun_private', :access_token => 'access_token', :status => [401, 'Unauthorized'] do lambda do FbGraph::User.new('arjun', :access_token => 'access_token').friends end.should raise_exception(FbGraph::Unauthorized) end end end context 'when identifier is me and no access_token is given' do it 'should raise FbGraph::Unauthorized' do mock_graph :get, 'me/friends', 'users/friends/me_public', :status => [401, 'Unauthorized'] do lambda do FbGraph::User.new('me').friends end.should raise_exception(FbGraph::Unauthorized) end end end context 'when identifier is me and access_token is given' do it 'should return friends as FbGraph::User' do mock_graph :get, 'me/friends', 'users/friends/me_private', :access_token => 'access_token' do users = FbGraph::User.new('me', :access_token => 'access_token').friends users.first.should == FbGraph::User.new( '6401', :access_token => 'access_token', :name => 'Kirk McMurray' ) users.each do |user| user.should be_instance_of(FbGraph::User) end end end end end end
Version data entries
104 entries across 104 versions & 1 rubygems