|
|
@ -6,12 +6,18 @@ RSpec.describe "Form Check Answers Page" do |
|
|
|
let(:user) { FactoryBot.create(:user) } |
|
|
|
let(:user) { FactoryBot.create(:user) } |
|
|
|
let(:subsection) { "household-characteristics" } |
|
|
|
let(:subsection) { "household-characteristics" } |
|
|
|
let(:conditional_subsection) { "conditional-question" } |
|
|
|
let(:conditional_subsection) { "conditional-question" } |
|
|
|
|
|
|
|
let(:scheme) { FactoryBot.create(:scheme, owning_organisation: user.organisation) } |
|
|
|
|
|
|
|
let(:location) { FactoryBot.create(:location, scheme:) } |
|
|
|
|
|
|
|
|
|
|
|
let(:case_log) do |
|
|
|
let(:case_log) do |
|
|
|
FactoryBot.create( |
|
|
|
FactoryBot.create( |
|
|
|
:case_log, |
|
|
|
:case_log, |
|
|
|
:in_progress, |
|
|
|
:in_progress, |
|
|
|
owning_organisation: user.organisation, |
|
|
|
owning_organisation: user.organisation, |
|
|
|
managing_organisation: user.organisation, |
|
|
|
managing_organisation: user.organisation, |
|
|
|
|
|
|
|
needstype: 2, |
|
|
|
|
|
|
|
scheme:, |
|
|
|
|
|
|
|
location:, |
|
|
|
) |
|
|
|
) |
|
|
|
end |
|
|
|
end |
|
|
|
let(:empty_case_log) do |
|
|
|
let(:empty_case_log) do |
|
|
@ -127,6 +133,19 @@ RSpec.describe "Form Check Answers Page" do |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when viewing setup section answers" do |
|
|
|
|
|
|
|
before do |
|
|
|
|
|
|
|
FactoryBot.create(:location, scheme:) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "displays inferred postcode with the location id" do |
|
|
|
|
|
|
|
case_log.update!(location:) |
|
|
|
|
|
|
|
visit("/logs/#{id}/setup/check-answers") |
|
|
|
|
|
|
|
expect(page).to have_content("Location") |
|
|
|
|
|
|
|
expect(page).to have_content(location.name) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when the user changes their answer from check answer page" do |
|
|
|
context "when the user changes their answer from check answer page" do |
|
|
|
it "routes back to check answers" do |
|
|
|
it "routes back to check answers" do |
|
|
|
visit("/logs/#{empty_case_log.id}/accessibility-requirements") |
|
|
|
visit("/logs/#{empty_case_log.id}/accessibility-requirements") |
|
|
|