From cc6d7d28828923e564e8063fb73005d95913df48 Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Fri, 29 Apr 2022 17:32:57 +0100 Subject: [PATCH] Add test for support user log view --- spec/requests/case_logs_controller_spec.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/spec/requests/case_logs_controller_spec.rb b/spec/requests/case_logs_controller_spec.rb index 25265c8cf..1afdba628 100644 --- a/spec/requests/case_logs_controller_spec.rb +++ b/spec/requests/case_logs_controller_spec.rb @@ -149,6 +149,7 @@ RSpec.describe CaseLogsController, type: :request do :case_log, owning_organisation: organisation, managing_organisation: organisation, + tenant_code: "LC783" ) end let!(:unauthorized_case_log) do @@ -156,6 +157,7 @@ RSpec.describe CaseLogsController, type: :request do :case_log, owning_organisation: other_organisation, managing_organisation: other_organisation, + tenant_code: "UA984" ) end @@ -176,6 +178,12 @@ RSpec.describe CaseLogsController, type: :request do expect(page).to have_content("Managing organisation") end + it "shows case logs for all organisations" do + get "/logs", headers: headers, params: {} + expect(page).to have_content("LC783") + expect(page).to have_content("UA984") + end + context "when filtering" do context "with status filter" do let!(:in_progress_case_log) do @@ -440,7 +448,8 @@ RSpec.describe CaseLogsController, type: :request do end it "displays a section status for a case log" do - assert_select ".govuk-tag", text: /Not started/, count: 8 + assert_select ".govuk-tag", text: /Not started/, count: 7 + assert_select ".govuk-tag", text: /In progress/, count: 1 assert_select ".govuk-tag", text: /Completed/, count: 0 assert_select ".govuk-tag", text: /Cannot start yet/, count: 1 end