1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
require 'spec_helper'
if ApiPagination.config.paginator == :will_paginate
require 'sqlite3'
require 'sequel'
require 'will_paginate/sequel'
DB = Sequel.sqlite
DB.extension :pagination
DB.create_table :people do
primary_key :id
String :name
end
describe 'Using will_paginate with Sequel' do
let(:people) do
DB[:people]
end
before(:each) do
people.insert(name: 'John')
people.insert(name: 'Mary')
end
it 'returns a Sequel::Dataset' do
collection = ApiPagination.paginate(people).first
expect(collection.kind_of?(Sequel::Dataset)).to be_truthy
end
end
end
|