File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -281,6 +281,14 @@ class Fixnum
281
281
end
282
282
end
283
283
284
+ after :all do
285
+ class Fixnum
286
+ class << self
287
+ undef_method :default_per_page , :per_page
288
+ end
289
+ end
290
+ end
291
+
284
292
it 'should use default per page from model' do
285
293
get :index_with_no_per_page , params : { count : 100 }
286
294
@@ -302,17 +310,10 @@ class Fixnum
302
310
end
303
311
)
304
312
end
313
+ end
305
314
306
- # This spec has to be last because if we undefine these methods
307
- # at runtime and then invoke another test that uses them, they will
308
- # raise a NoMethodError
315
+ context 'default per page in objects without paginator defaults' do
309
316
it 'should not fail if model does not respond to per page' do
310
- class Fixnum
311
- class << self
312
- undef_method :default_per_page , :per_page
313
- end
314
- end
315
-
316
317
get :index_with_no_per_page , params : { count : 100 }
317
318
318
319
expect ( response . header [ 'Per-Page' ] ) . to eq (
You can’t perform that action at this time.
0 commit comments