Sha256: 7608ab68805bd7138c7969452817cc2363a9e045f59ff62775a744eb31abc6c4

Contents?: true

Size: 990 Bytes

Versions: 4

Compression:

Stored size: 990 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?access_token=access_token', 'users/activities/arjun_private')
    end

    it 'should raise FbGraph::Unauthorized when no access_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', :access_token => 'access_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

4 entries across 4 versions & 1 rubygems

Version Path
fb_graph-0.0.7 spec/fb_graph/connections/activities_spec.rb
fb_graph-0.0.6 spec/fb_graph/connections/activities_spec.rb
fb_graph-0.0.5 spec/fb_graph/connections/activities_spec.rb
fb_graph-0.0.4 spec/fb_graph/connections/activities_spec.rb