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
281281 end
282282 end
283283
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+
284292 it 'should use default per page from model' do
285293 get :index_with_no_per_page , params : { count : 100 }
286294
@@ -302,17 +310,10 @@ class Fixnum
302310 end
303311 )
304312 end
313+ end
305314
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
309316 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-
316317 get :index_with_no_per_page , params : { count : 100 }
317318
318319 expect ( response . header [ 'Per-Page' ] ) . to eq (
You can’t perform that action at this time.
0 commit comments