Sha256: 90250de183e8677b5fd40358bc3f95979878e0432a3898d83b70f0f365e7fced

Contents?: true

Size: 926 Bytes

Versions: 5

Compression:

Stored size: 926 Bytes

Contents

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

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

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

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

Version data entries

5 entries across 5 versions & 1 rubygems

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