We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a1b56cf commit b3b6148Copy full SHA for b3b6148
spec/api-pagination_spec.rb
@@ -0,0 +1,30 @@
1
+require 'spec_helper'
2
+
3
+describe ApiPagination do
4
+ let(:collection) { (1..100).to_a }
5
+ let(:paginate_array_options) { { total_count: 1000 } }
6
7
+ context 'Using kaminari' do
8
+ before do
9
+ ApiPagination.config.paginator = :kaminari
10
+ end
11
12
+ after do
13
+ ApiPagination.config.paginator = ENV['PAGINATOR'].to_sym
14
15
16
+ it 'should accept paginate_array_options option' do
17
+ expect(Kaminari).to receive(:paginate_array)
18
+ .with(collection, paginate_array_options)
19
+ .and_call_original
20
21
+ ApiPagination.paginate(
22
+ collection,
23
+ {
24
+ per_page: 30,
25
+ paginate_array_options: paginate_array_options
26
+ }
27
+ )
28
29
30
+end
0 commit comments