Sha256: 61b6c616b05d6335b9b92105b37f8da2db4d2daec57babb35dd3e056985d6703

Contents?: true

Size: 955 Bytes

Versions: 1

Compression:

Stored size: 955 Bytes

Contents

require File.join(File.dirname(__FILE__), '../../spec_helper')

describe FbGraph::Connections::Activities, '#activities' do
  describe 'when included by FbGraph::User' do
    before(:all) do
      fake_json(:get, 'arjun/activities', 'users/activities/arjun_public')
      fake_json(:get, 'arjun/activities?token=token', 'users/activities/arjun_private')
    end

    it 'should raise FbGraph::Unauthorized when no token given' do
      lambda do
        FbGraph::User.new('arjun').activities
      end.should raise_exception(FbGraph::Unauthorized)
    end

    it 'should return liked pages' do
      activities = FbGraph::User.new('arjun', :token => 'token').activities
      activities.first.should == FbGraph::Page.new(
        '378209722137',
        :name => 'Doing Things at the Last Minute',
        :category => '活動'
      )
      activities.each do |activity|
        activity.should be_instance_of(FbGraph::Page)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fb_graph-0.0.3 spec/fb_graph/connections/activities_spec.rb