Browse Source

Add total count

pull/440/head
baarkerlounger 3 years ago
parent
commit
9d8edd3282
  1. 8
      spec/requests/case_logs_controller_spec.rb

8
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 <b>1</b> to <b>20</b> logs")
expect(CGI.unescape_html(response.body)).to match("Showing <b>1</b> to <b>20</b> of <b>26</b> 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 <b>21</b> to <b>26</b> logs")
expect(CGI.unescape_html(response.body)).to match("Showing <b>21</b> to <b>26</b> of <b>26</b> logs")
end
end
end

Loading…
Cancel
Save