From 500b3de116e5e92e02c0f061345b1c0238d665b7 Mon Sep 17 00:00:00 2001 From: Morgan Roderick Date: Thu, 15 Oct 2026 10:28:05 +0200 Subject: [PATCH] fix: replace removed pagy_bootstrap_nav helper in invitation logs index pagy 43 removed the legacy pagy_* helpers, so the view raised NoMethodError as soon as an invitation log spanned more than one page. Call series_nav(:bootstrap), the same helper the shared pagination partial uses, and cover the multi-page render with a controller spec. --- .../admin/workshop_invitation_logs/index.html.haml | 2 +- .../workshop_invitation_logs_controller_spec.rb | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/views/admin/workshop_invitation_logs/index.html.haml b/app/views/admin/workshop_invitation_logs/index.html.haml index e536aee5f..0b0b73207 100644 --- a/app/views/admin/workshop_invitation_logs/index.html.haml +++ b/app/views/admin/workshop_invitation_logs/index.html.haml @@ -9,4 +9,4 @@ - else = render partial: 'invitation_log', collection: @logs - = pagy_bootstrap_nav(@pagy) if @pagy.pages > 1 \ No newline at end of file + = @pagy.series_nav(:bootstrap) if @pagy.pages > 1 diff --git a/spec/controllers/admin/workshop_invitation_logs_controller_spec.rb b/spec/controllers/admin/workshop_invitation_logs_controller_spec.rb index 910f3c509..7c82e501a 100644 --- a/spec/controllers/admin/workshop_invitation_logs_controller_spec.rb +++ b/spec/controllers/admin/workshop_invitation_logs_controller_spec.rb @@ -22,6 +22,19 @@ expect(response).to have_http_status(:redirect) end + + context 'when logs span more than one page' do + render_views + + it 'renders the pagination nav' do + Fabricate.times(21, :invitation_log, loggable: workshop, status: 'completed') + + get :index, params: { workshop_id: workshop.id } + + expect(response).to have_http_status(:success) + expect(response.body).to include('pagy-bootstrap') + end + end end describe 'GET #show' do