From 9d8edd3282693fc33c57f6760c6757fe78220ca3 Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Thu, 31 Mar 2022 11:37:07 +0100 Subject: [PATCH] Add total count --- spec/requests/case_logs_controller_spec.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/spec/requests/case_logs_controller_spec.rb b/spec/requests/case_logs_controller_spec.rb index 788ec70a3..857e0f1b2 100644 --- a/spec/requests/case_logs_controller_spec.rb +++ b/spec/requests/case_logs_controller_spec.rb @@ -274,9 +274,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 @@ -289,7 +287,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 @@ -310,7 +308,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