Sha256: cff082fd5128f50f635f9a2621a5bde3dd2c97381474a41aa0960f44c60abd75

Contents?: true

Size: 1.01 KB

Versions: 17

Compression:

Stored size: 1.01 KB

Contents

# encoding: utf-8
#
require 'spec_helper'

describe Internals::Adapters::Rack::Query do
  
  before(:each) do
    @query   = stub :query
    @adapter = described_class.new @query
  end
  
  describe 'to_app' do
    it 'works' do
      lambda { @adapter.to_app }.should_not raise_error
    end
    it 'returns the right thing' do
      @adapter.to_app.should respond_to(:call)
    end
  end
  
  describe 'extracted' do
    it 'extracts the query' do
      @adapter.extracted('query' => 'some_query')[0].should == 'some_query'
    end
    it 'extracts the default ids amount' do
      @adapter.extracted('query' => 'some_query')[1].should == 20
    end
    it 'extracts the default offset' do
      @adapter.extracted('query' => 'some_query')[2].should == 0
    end
    it 'extracts a given ids amount' do
      @adapter.extracted('query' => 'some_query', 'ids' => '123')[1].should == 123
    end
    it 'extracts a given offset' do
      @adapter.extracted('query' => 'some_query', 'offset' => '123')[2].should == 123
    end
  end
  
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
picky-2.5.2 spec/lib/internals/adapters/rack/query_spec.rb
picky-2.5.1 spec/lib/internals/adapters/rack/query_spec.rb
picky-2.5.0 spec/lib/internals/adapters/rack/query_spec.rb
picky-2.4.3 spec/lib/internals/adapters/rack/query_spec.rb
picky-2.4.2 spec/lib/internals/adapters/rack/query_spec.rb
picky-2.4.1 spec/lib/internals/adapters/rack/query_spec.rb
picky-2.4.0 spec/lib/internals/adapters/rack/query_spec.rb
picky-2.3.0 spec/lib/internals/adapters/rack/query_spec.rb
picky-2.2.1 spec/lib/internals/adapters/rack/query_spec.rb
picky-2.2.0 spec/lib/internals/adapters/rack/query_spec.rb
picky-2.1.2 spec/lib/internals/adapters/rack/query_spec.rb
picky-2.1.1 spec/lib/internals/adapters/rack/query_spec.rb
picky-2.1.0 spec/lib/internals/adapters/rack/query_spec.rb
picky-2.0.0 spec/lib/internals/adapters/rack/query_spec.rb
picky-2.0.0.pre3 spec/lib/internals/adapters/rack/query_spec.rb
picky-2.0.0.pre2 spec/lib/internals/adapters/rack/query_spec.rb
picky-2.0.0.pre1 spec/lib/internals/adapters/rack/query_spec.rb