Sha256: a2bc20dbb76c2ef8fcaf214224903a2d157d6c355eda259673e7b401fd1a7db6

Contents?: true

Size: 1.18 KB

Versions: 32

Compression:

Stored size: 1.18 KB

Contents

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

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

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

    context 'when access_token is given' do
      it 'should return activities as FbGraph::Page' do
        activities = FbGraph::User.new('arjun', :access_token => 'access_token').activities
        activities.class.should == FbGraph::Connection
        activities.first.should == FbGraph::Page.new(
          '378209722137',
          :access_token => 'access_token',
          :name => 'Doing Things at the Last Minute',
          :category => '活動'
        )
        activities.each do |activity|
          activity.should be_instance_of(FbGraph::Page)
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
fb_graph-1.6.7 spec/fb_graph/connections/activities_spec.rb
fb_graph-1.6.5 spec/fb_graph/connections/activities_spec.rb
fb_graph-1.6.4 spec/fb_graph/connections/activities_spec.rb
fb_graph-1.6.3 spec/fb_graph/connections/activities_spec.rb
fb_graph-1.6.2 spec/fb_graph/connections/activities_spec.rb
fb_graph-1.6.1 spec/fb_graph/connections/activities_spec.rb
fb_graph-1.6.0 spec/fb_graph/connections/activities_spec.rb
fb_graph-1.5.5 spec/fb_graph/connections/activities_spec.rb
fb_graph-1.5.4 spec/fb_graph/connections/activities_spec.rb
fb_graph-1.5.3 spec/fb_graph/connections/activities_spec.rb
fb_graph-1.5.2 spec/fb_graph/connections/activities_spec.rb
fb_graph-1.5.1 spec/fb_graph/connections/activities_spec.rb
fb_graph-1.5.0 spec/fb_graph/connections/activities_spec.rb
fb_graph-1.4.1 spec/fb_graph/connections/activities_spec.rb
fb_graph-1.4.0 spec/fb_graph/connections/activities_spec.rb
fb_graph-1.3.9 spec/fb_graph/connections/activities_spec.rb
fb_graph-1.3.8 spec/fb_graph/connections/activities_spec.rb
fb_graph-1.3.7 spec/fb_graph/connections/activities_spec.rb
fb_graph-1.3.6 spec/fb_graph/connections/activities_spec.rb
fb_graph-1.3.5 spec/fb_graph/connections/activities_spec.rb