|
|
@ -149,6 +149,7 @@ RSpec.describe CaseLogsController, type: :request do |
|
|
|
:case_log, |
|
|
|
:case_log, |
|
|
|
owning_organisation: organisation, |
|
|
|
owning_organisation: organisation, |
|
|
|
managing_organisation: organisation, |
|
|
|
managing_organisation: organisation, |
|
|
|
|
|
|
|
tenant_code: "LC783" |
|
|
|
) |
|
|
|
) |
|
|
|
end |
|
|
|
end |
|
|
|
let!(:unauthorized_case_log) do |
|
|
|
let!(:unauthorized_case_log) do |
|
|
@ -156,6 +157,7 @@ RSpec.describe CaseLogsController, type: :request do |
|
|
|
:case_log, |
|
|
|
:case_log, |
|
|
|
owning_organisation: other_organisation, |
|
|
|
owning_organisation: other_organisation, |
|
|
|
managing_organisation: other_organisation, |
|
|
|
managing_organisation: other_organisation, |
|
|
|
|
|
|
|
tenant_code: "UA984" |
|
|
|
) |
|
|
|
) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
@ -176,6 +178,12 @@ RSpec.describe CaseLogsController, type: :request do |
|
|
|
expect(page).to have_content("Managing organisation") |
|
|
|
expect(page).to have_content("Managing organisation") |
|
|
|
end |
|
|
|
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 "when filtering" do |
|
|
|
context "with status filter" do |
|
|
|
context "with status filter" do |
|
|
|
let!(:in_progress_case_log) do |
|
|
|
let!(:in_progress_case_log) do |
|
|
@ -440,7 +448,8 @@ RSpec.describe CaseLogsController, type: :request do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "displays a section status for a case log" do |
|
|
|
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: /Completed/, count: 0 |
|
|
|
assert_select ".govuk-tag", text: /Cannot start yet/, count: 1 |
|
|
|
assert_select ".govuk-tag", text: /Cannot start yet/, count: 1 |
|
|
|
end |
|
|
|
end |
|
|
|