Sha256: f4e6a9bc2cdece1754d172a89638810a4893bd5e22e4d13e67d154d5e73e05cf

Contents?: true

Size: 1.09 KB

Versions: 7

Compression:

Stored size: 1.09 KB

Contents

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

context 'when included by FbGraph::User' do
  describe FbGraph::Connections::Activities, '#activities' 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

    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.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
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fb_graph-0.2.2 spec/fb_graph/connections/activities_spec.rb
fb_graph-0.2.1 spec/fb_graph/connections/activities_spec.rb
fb_graph-0.2.0 spec/fb_graph/connections/activities_spec.rb
fb_graph-0.1.3 spec/fb_graph/connections/activities_spec.rb
fb_graph-0.1.2 spec/fb_graph/connections/activities_spec.rb
fb_graph-0.1.1 spec/fb_graph/connections/activities_spec.rb
fb_graph-0.1.0 spec/fb_graph/connections/activities_spec.rb