Skip to content

Commit 481ffa4

Browse files
committed
clean up active_record spec and add missing pagy clause to rails_spec
1 parent 87a93b3 commit 481ffa4

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

spec/active_record_spec.rb

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,13 @@
2020
describe 'ActiveRecord Support' do
2121
let(:collection) { Foo.all }
2222
let(:per_page) { 5 }
23-
24-
if ApiPagination.config.paginator == :kaminari
25-
context 'pagination with kaminari' do
26-
include_examples 'produces_correct_sql'
27-
end
28-
end
2923

3024
if ApiPagination.config.paginator == :will_paginate
3125
require 'will_paginate/active_record'
32-
33-
context 'pagination with will_paginate' do
34-
include_examples 'produces_correct_sql'
35-
end
26+
end
27+
28+
context "pagination with #{ApiPagination.config.paginator}" do
29+
include_examples 'produces_correct_sql'
3630
end
3731

3832
context 'reflections' do

spec/rails_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ class Fixnum
294294

295295
expect(response.header['Per-Page']).to eq(
296296
case ApiPagination.config.paginator
297+
when :pagy then Pagy::VARS[:items].to_s
297298
when :kaminari then Kaminari.config.default_per_page.to_s
298299
when :will_paginate then WillPaginate.per_page.to_s
299300
end

0 commit comments

Comments
 (0)