Sha256: 6c8c84a65f6d2037d1c458c71053390caa09175be24435b23ecca80c92bf3f08

Contents?: true

Size: 1003 Bytes

Versions: 32

Compression:

Stored size: 1003 Bytes

Contents

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

describe FbGraph::Searchable do
  context 'when included by FbGraph::Page' do
    it 'should with type=page' do
      lambda do
        FbGraph::Page.search('FbGraph')
      end.should request_to('search?q=FbGraph&type=page')
    end
  end
end

describe FbGraph::Searchable::Result do
  before do
    fake_json :get, 'search?q=fbgraph&type=page', 'pages/search_fb_graph'
    fake_json :get, 'search?limit=25&offset=25&q=google&type=page', 'pages/search_google'
    @fb_graph = FbGraph::Page.search('fbgraph')
    @google_page2 = FbGraph::Page.search('google', :limit => 25, :offset => 25)
  end

  it 'should support pagination' do
    @fb_graph.next.should     == []
    @fb_graph.previous.should == []
    lambda do
      @google_page2.next
    end.should request_to('search?limit=25&offset=50&q=google&type=page')
    lambda do
      @google_page2.previous
    end.should request_to('search?limit=25&offset=0&q=google&type=page')
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
fb_graph-1.7.0 spec/fb_graph/searchable_spec.rb
fb_graph-1.7.0.alpha2 spec/fb_graph/searchable_spec.rb
fb_graph-1.6.9 spec/fb_graph/searchable_spec.rb
fb_graph-1.7.0.alpha spec/fb_graph/searchable_spec.rb
fb_graph-1.6.8 spec/fb_graph/searchable_spec.rb
fb_graph-1.6.7 spec/fb_graph/searchable_spec.rb
fb_graph-1.6.5 spec/fb_graph/searchable_spec.rb
fb_graph-1.6.4 spec/fb_graph/searchable_spec.rb
fb_graph-1.6.3 spec/fb_graph/searchable_spec.rb
fb_graph-1.6.2 spec/fb_graph/searchable_spec.rb
fb_graph-1.6.1 spec/fb_graph/searchable_spec.rb
fb_graph-1.6.0 spec/fb_graph/searchable_spec.rb
fb_graph-1.5.5 spec/fb_graph/searchable_spec.rb
fb_graph-1.5.4 spec/fb_graph/searchable_spec.rb
fb_graph-1.5.3 spec/fb_graph/searchable_spec.rb
fb_graph-1.5.2 spec/fb_graph/searchable_spec.rb
fb_graph-1.5.1 spec/fb_graph/searchable_spec.rb
fb_graph-1.5.0 spec/fb_graph/searchable_spec.rb
fb_graph-1.4.1 spec/fb_graph/searchable_spec.rb
fb_graph-1.4.0 spec/fb_graph/searchable_spec.rb