Reduce number of records in pagination tests
Creating more than 25 records isn't necessary to test pagination; we can stub the number of records per page in a test. On my machine we save about one second per test with these changes.
This commit is contained in:
@@ -80,8 +80,8 @@ describe "Admin proposal notifications" do
|
||||
end
|
||||
|
||||
scenario "Action links remember the pagination setting and the filter" do
|
||||
per_page = Kaminari.config.default_per_page
|
||||
(per_page + 2).times { create(:proposal_notification, :hidden, :with_confirmed_hide) }
|
||||
allow(ProposalNotification).to receive(:default_per_page).and_return(2)
|
||||
4.times { create(:proposal_notification, :hidden, :with_confirmed_hide) }
|
||||
|
||||
visit admin_proposal_notifications_path(filter: "with_confirmed_hide", page: 2)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user