Sha256: aef149715d02856485534299c264837e6ec9007a05bd7cbf09c4b84d6a84cab5

Contents?: true

Size: 1.27 KB

Versions: 23

Compression:

Stored size: 1.27 KB

Contents

require File.join(File.dirname(__FILE__), '../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
  before do
    fake_json(:get, 'search?type=checkin', 'checkins/search_public')
    fake_json(:get, 'search?type=checkin&access_token=access_token', 'checkins/search_private')
  end

  context 'when no access_token given' do
    it 'should raise FbGraph::Unauthorized' do
      lambda do
        FbGraph::Checkin.search
      end.should raise_exception(FbGraph::Unauthorized)
    end
  end

  context 'when access_token is given' do
    it 'should return checkins as FbGraph::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

Version data entries

23 entries across 23 versions & 1 rubygems

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