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:
Javi Martín
2019-11-10 14:12:21 +01:00
parent 2228ac3781
commit bd03e249ce
19 changed files with 40 additions and 29 deletions

View File

@@ -91,7 +91,8 @@ describe "Proposals" do
end
scenario "Pagination" do
per_page = Kaminari.config.default_per_page
per_page = 3
allow(Proposal).to receive(:default_per_page).and_return(per_page)
(per_page + 2).times { create(:proposal) }
visit proposals_path