Sha256: 2e866e0028d07d2ba7d205c0dec07038c69f3c4506909b42626f75062ee944f1

Contents?: true

Size: 832 Bytes

Versions: 5

Compression:

Stored size: 832 Bytes

Contents

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

describe FbGraph::Checkin, '.new' do
  # TODO
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

5 entries across 5 versions & 1 rubygems

Version Path
fb_graph-1.2.3 spec/fb_graph/checkin_spec.rb
fb_graph-1.2.2 spec/fb_graph/checkin_spec.rb
fb_graph-1.2.1 spec/fb_graph/checkin_spec.rb
fb_graph-1.2.0 spec/fb_graph/checkin_spec.rb
fb_graph-1.1.7 spec/fb_graph/checkin_spec.rb