diff --git a/app/views/pagy/_nav.html.erb b/app/views/pagy/_nav.html.erb index aea319573..9f7cf2cf7 100644 --- a/app/views/pagy/_nav.html.erb +++ b/app/views/pagy/_nav.html.erb @@ -33,6 +33,6 @@

- Showing <%= pagy.from %> to <%= pagy.to %> logs + Showing <%= pagy.from %> to <%= pagy.to %> of <%= pagy.count %> logs

diff --git a/spec/requests/case_logs_controller_spec.rb b/spec/requests/case_logs_controller_spec.rb index 38e3aa412..74e79e421 100644 --- a/spec/requests/case_logs_controller_spec.rb +++ b/spec/requests/case_logs_controller_spec.rb @@ -191,9 +191,7 @@ RSpec.describe CaseLogsController, type: :request do context "when there are more than 20 logs" do before do - 25.times do - FactoryBot.create(:case_log, owning_organisation: organisation, managing_organisation: organisation,) - end + FactoryBot.create_list(:case_log, 25, owning_organisation: organisation, managing_organisation: organisation) get "/logs", headers: headers, params: {} end @@ -206,7 +204,7 @@ RSpec.describe CaseLogsController, type: :request do end it "shows which logs are being shown on the current page" do - expect(CGI.unescape_html(response.body)).to match("Showing 1 to 20 logs") + expect(CGI.unescape_html(response.body)).to match("Showing 1 to 20 of 26 logs") end end @@ -227,7 +225,7 @@ RSpec.describe CaseLogsController, type: :request do end it "shows which logs are being shown on the current page" do - expect(CGI.unescape_html(response.body)).to match("Showing 21 to 26 logs") + expect(CGI.unescape_html(response.body)).to match("Showing 21 to 26 of 26 logs") end end end