Sha256: 3fdf63b7aed44604531043685af6392ff76fc40e0a66bc96601664c9f13b6d52
Contents?: true
Size: 1.03 KB
Versions: 32
Compression:
Stored size: 1.03 KB
Contents
require File.join(File.dirname(__FILE__), '../../spec_helper') describe FbGraph::Connections::Groups, '#groups' do context 'when included by FbGraph::User' do before do fake_json(:get, 'matake/groups', 'users/groups/matake_public') fake_json(:get, 'matake/groups?access_token=access_token', 'users/groups/matake_private') end context 'when no access_token given' do it 'should raise FbGraph::Unauthorized' do lambda do FbGraph::User.new('matake').groups end.should raise_exception(FbGraph::Unauthorized) end end context 'when access_token is given' do it 'should return groups as FbGraph::Group' do groups = FbGraph::User.new('matake', :access_token => 'access_token').groups groups.first.should == FbGraph::Group.new( '115286585902', :access_token => 'access_token', :name => 'iPhone 3G S' ) groups.each do |group| group.should be_instance_of(FbGraph::Group) end end end end end
Version data entries
32 entries across 32 versions & 1 rubygems