Sha256: 072f66f096edc8331ff1fa004268752e952c5be88444a124427da8590c957c90

Contents?: true

Size: 1.07 KB

Versions: 20

Compression:

Stored size: 1.07 KB

Contents

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

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

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

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

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
fb_graph-1.0.7 spec/fb_graph/connections/likes_spec.rb
fb_graph-1.0.6 spec/fb_graph/connections/likes_spec.rb
fb_graph-1.0.5 spec/fb_graph/connections/likes_spec.rb
palidanx-fb_graph-1.0.4 spec/fb_graph/connections/likes_spec.rb
fb_graph-1.0.4 spec/fb_graph/connections/likes_spec.rb
fb_graph-1.0.3 spec/fb_graph/connections/likes_spec.rb
fb_graph-1.0.2 spec/fb_graph/connections/likes_spec.rb
fb_graph-1.0.1 spec/fb_graph/connections/likes_spec.rb
fb_graph-1.0.0 spec/fb_graph/connections/likes_spec.rb
fb_graph-0.8.0 spec/fb_graph/connections/likes_spec.rb
fb_graph-0.7.3 spec/fb_graph/connections/likes_spec.rb
fb_graph-0.7.2 spec/fb_graph/connections/likes_spec.rb
fb_graph-0.7.1 spec/fb_graph/connections/likes_spec.rb
fb_graph-0.7.0 spec/fb_graph/connections/likes_spec.rb
fb_graph-0.6.0 spec/fb_graph/connections/likes_spec.rb
fb_graph-0.5.0 spec/fb_graph/connections/likes_spec.rb
fb_graph-0.4.2 spec/fb_graph/connections/likes_spec.rb
fb_graph-0.4.1 spec/fb_graph/connections/likes_spec.rb
fb_graph-0.4.0 spec/fb_graph/connections/likes_spec.rb
fb_graph-0.3.0 spec/fb_graph/connections/likes_spec.rb