Sha256: fe93b261150b8dc9abf8a2813b05f17656a8814f842c674cbf61f35e97d54190

Contents?: true

Size: 1.15 KB

Versions: 1

Compression:

Stored size: 1.15 KB

Contents

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

describe FbGraph::Connections::Albums, '#albums' do
  describe 'when included by FbGraph::User' do
    before(:all) do
      fake_json(:get, 'matake/albums', 'users/albums/matake_public')
      fake_json(:get, 'matake/albums?token=token', 'users/albums/matake_private')
    end

    it 'should raise FbGraph::Unauthorized when no token given' do
      lambda do
        FbGraph::User.new('matake').albums
      end.should raise_exception(FbGraph::Unauthorized)
    end

    it 'should return liked pages' do
      albums = FbGraph::User.new('matake', :token => 'token').albums
      albums.first.should == FbGraph::Album.new(
        '19351532276',
        :from => {
          :id => '579612276',
          :name => 'Nov Matake'
        },
        :name => 'モバイルアップロード',
        :link => 'http://www.facebook.com/album.php?aid=25463&id=579612276',
        :count => 3,
        :created_time => '2008-07-27T11:38:15+0000',
        :updated_time => '2009-02-07T16:09:53+0000'
      )
      albums.each do |album|
        album.should be_instance_of(FbGraph::Album)
      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/albums_spec.rb