Skip to content

Commit

Permalink
Merge pull request #3223 from DFE-Digital/pagy-9
Browse files Browse the repository at this point in the history
Upgrade pagy 8.6.3 => 9.0.9
  • Loading branch information
asmega authored Sep 27, 2024
2 parents 1d87be8 + 9f6e5af commit 10b92eb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,10 @@ GEM
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
govuk-components (5.4.0)
govuk-components (5.6.1)
html-attributes-utils (~> 1.0.0, >= 1.0.0)
pagy (>= 6, < 9)
view_component (>= 3.9, < 3.13)
pagy (>= 6, < 10)
view_component (>= 3.9, < 3.15)
govuk_design_system_formbuilder (5.4.0)
actionview (>= 6.1)
activemodel (>= 6.1)
Expand Down Expand Up @@ -325,7 +325,7 @@ GEM
webfinger (~> 1.2)
os (1.1.4)
ostruct (0.6.0)
pagy (8.6.3)
pagy (9.0.9)
parallel (1.25.1)
parallel_tests (4.7.1)
parallel
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/pagy.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "pagy/extras/overflow"
require "pagy/extras/pagy"

Pagy::DEFAULT[:items] = 50
Pagy::DEFAULT[:limit] = 50
Pagy::DEFAULT[:overflow] = :last_page
Pagy::DEFAULT[:size] = [1, 1, 1, 1]
6 changes: 3 additions & 3 deletions spec/features/admin/admin_payroll_runs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@
scenario "Payments can be browsed using pagination" do
payroll_run = create(:payroll_run, claims_counts: {Policies::StudentLoans => 7})

stub_const("Pagy::DEFAULT", Pagy::DEFAULT.merge(items: 5))
stub_const("Pagy::DEFAULT", Pagy::DEFAULT.merge(limit: 5))

first_page_payments = payroll_run.payments.ordered[0..Pagy::DEFAULT[:items] - 1]
second_page_payments = payroll_run.payments.ordered[Pagy::DEFAULT[:items]..]
first_page_payments = payroll_run.payments.ordered[0..Pagy::DEFAULT[:limit] - 1]
second_page_payments = payroll_run.payments.ordered[Pagy::DEFAULT[:limit]..]

click_on "Payroll"
click_on "View #{I18n.l(payroll_run.created_at.to_date, format: :month_year)} payroll run"
Expand Down

0 comments on commit 10b92eb

Please sign in to comment.