Sha256: f433433c8813445ed03540e66e1d03bd9bfff80f1e42f60303e3cba5406b3563

Contents?: true

Size: 1.05 KB

Versions: 32

Compression:

Stored size: 1.05 KB

Contents

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

describe FbGraph::Connections::Books, '#books' do
  context 'when included by FbGraph::User' do
    before do
      fake_json(:get, 'matake/books', 'users/books/matake_public')
      fake_json(:get, 'matake/books?access_token=access_token', 'users/books/matake_private')
    end

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

    context 'when access_token is given' do
      it 'should return books as FbGraph::Page' do
        books = FbGraph::User.new('matake', :access_token => 'access_token').books
        books.first.should == FbGraph::Page.new(
          '102253616477130',
          :access_token => 'access_token',
          :name => 'Momo Michael Ende',
          :category => 'Unknown'
        )
        books.each do |book|
          book.should be_instance_of(FbGraph::Page)
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
fb_graph-1.6.7 spec/fb_graph/connections/books_spec.rb
fb_graph-1.6.5 spec/fb_graph/connections/books_spec.rb
fb_graph-1.6.4 spec/fb_graph/connections/books_spec.rb
fb_graph-1.6.3 spec/fb_graph/connections/books_spec.rb
fb_graph-1.6.2 spec/fb_graph/connections/books_spec.rb
fb_graph-1.6.1 spec/fb_graph/connections/books_spec.rb
fb_graph-1.6.0 spec/fb_graph/connections/books_spec.rb
fb_graph-1.5.5 spec/fb_graph/connections/books_spec.rb
fb_graph-1.5.4 spec/fb_graph/connections/books_spec.rb
fb_graph-1.5.3 spec/fb_graph/connections/books_spec.rb
fb_graph-1.5.2 spec/fb_graph/connections/books_spec.rb
fb_graph-1.5.1 spec/fb_graph/connections/books_spec.rb
fb_graph-1.5.0 spec/fb_graph/connections/books_spec.rb
fb_graph-1.4.1 spec/fb_graph/connections/books_spec.rb
fb_graph-1.4.0 spec/fb_graph/connections/books_spec.rb
fb_graph-1.3.9 spec/fb_graph/connections/books_spec.rb
fb_graph-1.3.8 spec/fb_graph/connections/books_spec.rb
fb_graph-1.3.7 spec/fb_graph/connections/books_spec.rb
fb_graph-1.3.6 spec/fb_graph/connections/books_spec.rb
fb_graph-1.3.5 spec/fb_graph/connections/books_spec.rb