Sha256: 6e3c055500ca29513432a682792b1faefbffa7484d42aa04ba6b21212be38725

Contents?: true

Size: 1.37 KB

Versions: 104

Compression:

Stored size: 1.37 KB

Contents

require 'spec_helper'

describe FbGraph::Checkin, '.new' do
  it 'should accept FbGraph::Place as place' do
    checkin = FbGraph::Checkin.new(12345, :place => FbGraph::Place.new(123456))
    checkin.place.should == FbGraph::Place.new(123456)
  end

  it 'should accept String/Integer as place' do
    checkin1 = FbGraph::Checkin.new(12345, :place => 123456)
    checkin2 = FbGraph::Checkin.new(12345, :place => '123456')
    checkin1.place.should == FbGraph::Place.new(123456)
    checkin2.place.should == FbGraph::Place.new('123456')
  end
end

describe FbGraph::Checkin, '.search' do
  context 'when no access_token given' do
    it 'should raise FbGraph::Unauthorized' do
      mock_graph :get, 'search', 'checkins/search_public', :params => {
        :type => 'checkin'
      }, :status => [401, 'Unauthorized'] do
        lambda do
          FbGraph::Checkin.search
        end.should raise_exception(FbGraph::Unauthorized)
      end
    end
  end

  context 'when access_token is given' do
    it 'should return checkins as FbGraph::Checkin' do
      mock_graph :get, 'search', 'checkins/search_private', :access_token => 'access_token', :params => {
        :type => 'checkin'
      } do
        checkins = FbGraph::Checkin.search(:access_token => 'access_token')
        checkins.each do |checkin|
          checkin.should be_instance_of(FbGraph::Checkin)
        end
      end
    end
  end
end

Version data entries

104 entries across 104 versions & 1 rubygems

Version Path
fb_graph-2.7.17 spec/fb_graph/checkin_spec.rb
fb_graph-2.7.16 spec/fb_graph/checkin_spec.rb
fb_graph-2.7.15 spec/fb_graph/checkin_spec.rb
fb_graph-2.7.14 spec/fb_graph/checkin_spec.rb
fb_graph-2.7.13 spec/fb_graph/checkin_spec.rb
fb_graph-2.7.12 spec/fb_graph/checkin_spec.rb
fb_graph-2.7.11 spec/fb_graph/checkin_spec.rb
fb_graph-2.7.10 spec/fb_graph/checkin_spec.rb
fb_graph-2.7.9 spec/fb_graph/checkin_spec.rb
fb_graph-2.7.8 spec/fb_graph/checkin_spec.rb
fb_graph-2.7.7 spec/fb_graph/checkin_spec.rb
fb_graph-2.7.6 spec/fb_graph/checkin_spec.rb
fb_graph-2.7.5 spec/fb_graph/checkin_spec.rb
fb_graph-2.7.4 spec/fb_graph/checkin_spec.rb
fb_graph-2.7.3 spec/fb_graph/checkin_spec.rb
fb_graph-2.7.2 spec/fb_graph/checkin_spec.rb
fb_graph-2.7.1 spec/fb_graph/checkin_spec.rb
fb_graph-2.7.0 spec/fb_graph/checkin_spec.rb
fb_graph-2.6.7 spec/fb_graph/checkin_spec.rb
fb_graph-2.6.6 spec/fb_graph/checkin_spec.rb