Sha256: 36311ff76de2b4e6acaed9147902bc7c9189d3f74dfd9f55bf83157dbb3789cf

Contents?: true

Size: 997 Bytes

Versions: 45

Compression:

Stored size: 997 Bytes

Contents

require '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
  let :fb_graph do
    mock_graph :get, 'search?q=fbgraph&type=page', 'pages/search_fb_graph' do
      FbGraph::Page.search('fbgraph')
    end
  end
  let :google_page2 do
    mock_graph :get, 'search?limit=25&offset=25&q=google&type=page', 'pages/search_google' do
      FbGraph::Page.search('google', :limit => 25, :offset => 25)
    end
  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

45 entries across 45 versions & 1 rubygems

Version Path
fb_graph-2.2.2 spec/fb_graph/searchable_spec.rb
fb_graph-2.2.1 spec/fb_graph/searchable_spec.rb
fb_graph-2.2.0 spec/fb_graph/searchable_spec.rb
fb_graph-2.2.0.beta spec/fb_graph/searchable_spec.rb
fb_graph-2.2.0.alpha2 spec/fb_graph/searchable_spec.rb
fb_graph-2.2.0.alpha spec/fb_graph/searchable_spec.rb
fb_graph-2.1.13 spec/fb_graph/searchable_spec.rb
fb_graph-2.1.12 spec/fb_graph/searchable_spec.rb
fb_graph-2.1.11 spec/fb_graph/searchable_spec.rb
fb_graph-2.1.10 spec/fb_graph/searchable_spec.rb
fb_graph-2.1.9 spec/fb_graph/searchable_spec.rb
fb_graph-2.1.8 spec/fb_graph/searchable_spec.rb
fb_graph-2.1.7 spec/fb_graph/searchable_spec.rb
fb_graph-2.1.6 spec/fb_graph/searchable_spec.rb
fb_graph-2.1.5 spec/fb_graph/searchable_spec.rb
fb_graph-2.1.4 spec/fb_graph/searchable_spec.rb
fb_graph-2.1.3 spec/fb_graph/searchable_spec.rb
fb_graph-2.1.2 spec/fb_graph/searchable_spec.rb
fb_graph-2.1.1 spec/fb_graph/searchable_spec.rb
fb_graph-2.1.0 spec/fb_graph/searchable_spec.rb