Skip to content

Commit 01f351a

Browse files
committed
[MODEL] Added an integration test case for pagination
Test, that Kaminari configuration in the model is used when paginating search results
1 parent ce08c52 commit 01f351a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

elasticsearch-model/test/integration/active_record_pagination_test.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,18 @@ class ::Article < ActiveRecord::Base
9090
assert records.last_page?, "Should be the last page"
9191
assert records.out_of_range?, "Should be out of range"
9292
end
93+
94+
context "with specific model settings" do
95+
teardown do
96+
Article.instance_variable_set(:@_default_per_page, nil)
97+
end
98+
end
99+
100+
should "respect paginates_per" do
101+
Article.paginates_per 50
102+
103+
assert_equal 50, Article.search('*').page(1).records.size
104+
end
93105
end
94106

95107
end

0 commit comments

Comments
 (0)