Sha256: b919aaca9d1e00b4c2c699c30bdc8ef393716089bac81152401d74985bca4e59

Contents?: true

Size: 891 Bytes

Versions: 1

Compression:

Stored size: 891 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?token=token', 'users/likes/arjun_private')
    end

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

1 entries across 1 versions & 1 rubygems

Version Path
fb_graph-0.0.3 spec/fb_graph/connections/likes_spec.rb