Sha256: 6f8fabc726e765889e16ad29b65284e21a24de6e9e5d19339885824b12961a84
Contents?: true
Size: 1.09 KB
Versions: 104
Compression:
Stored size: 1.09 KB
Contents
require 'spec_helper' describe FbGraph::Connections::Books, '#books' do context 'when included by FbGraph::User' do context 'when no access_token given' do it 'should raise FbGraph::Unauthorized' do mock_graph :get, 'matake/books', 'users/books/matake_public', :status => [401, 'Unauthorized'] do lambda do FbGraph::User.new('matake').books end.should raise_exception(FbGraph::Unauthorized) end end end context 'when access_token is given' do it 'should return books as FbGraph::Page' do mock_graph :get, 'matake/books', 'users/books/matake_private', :access_token => 'access_token' 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 end
Version data entries
104 entries across 104 versions & 1 rubygems