|
|
@ -375,191 +375,41 @@ RSpec.describe "Schemes scheme Features" do |
|
|
|
click_button "Save and continue" |
|
|
|
click_button "Save and continue" |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "lets me check my answers" do |
|
|
|
context "when I add location to the scheme" do |
|
|
|
expect(page).to have_content "Check your changes before updating this scheme" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "and I select to create a scheme" do |
|
|
|
|
|
|
|
before do |
|
|
|
before do |
|
|
|
click_link "Create scheme" |
|
|
|
fill_in "Postcode", with: "SW1P 4DF" |
|
|
|
end |
|
|
|
fill_in "Name(optional)", with: "Some name" |
|
|
|
|
|
|
|
fill_in "Total number of units at this location", with: 1 |
|
|
|
it "adds scheme to the list of schemes" do |
|
|
|
choose "Self-contained house" |
|
|
|
expect(page).to have_content "Supported housing schemes" |
|
|
|
click_button "Save and continue" |
|
|
|
expect(page).to have_content scheme.id_to_display |
|
|
|
|
|
|
|
expect(page).to have_content scheme.service_name |
|
|
|
|
|
|
|
expect(page).to have_content scheme.organisation.name |
|
|
|
|
|
|
|
expect(page).to have_content scheme.stock_owning_organisation.name |
|
|
|
|
|
|
|
expect(page).to have_content "#{scheme.organisation.name} has been created." |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when changing answers" do |
|
|
|
|
|
|
|
it "displays change links" do |
|
|
|
|
|
|
|
assert_selector "a", text: "Change", count: 12 |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when changing details" do |
|
|
|
|
|
|
|
before do |
|
|
|
|
|
|
|
click_link("Change", href: "/schemes/#{scheme.id}/details?check_answers=true", match: :first) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "allows changing details questions" do |
|
|
|
|
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/details?check_answers=true") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fill_in "Scheme name", with: "Example" |
|
|
|
|
|
|
|
choose "Direct access hostel" |
|
|
|
|
|
|
|
choose "Yes – registered care home providing nursing care" |
|
|
|
|
|
|
|
click_button "Save and continue" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/check-answers") |
|
|
|
|
|
|
|
expect(page).to have_content "Example" |
|
|
|
|
|
|
|
expect(page).to have_content "Yes – registered care home providing nursing care" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when I press the back button" do |
|
|
|
|
|
|
|
before do |
|
|
|
|
|
|
|
click_link "Back" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "lets me select the support answers" do |
|
|
|
|
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/check-answers") |
|
|
|
|
|
|
|
expect(page).to have_content "Check your changes before updating this scheme" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when changing primary client group" do |
|
|
|
|
|
|
|
before do |
|
|
|
|
|
|
|
click_link("Change", href: "/schemes/#{scheme.id}/primary-client-group?check_answers=true") |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "allows changing primary-client-group question" do |
|
|
|
|
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/primary-client-group?check_answers=true") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
choose "Older people with support needs" |
|
|
|
|
|
|
|
click_button "Save and continue" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/check-answers") |
|
|
|
|
|
|
|
expect(page).to have_content "Older people with support needs" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when I press the back button" do |
|
|
|
|
|
|
|
before do |
|
|
|
|
|
|
|
click_link "Back" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "lets me select the support answers" do |
|
|
|
|
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/check-answers") |
|
|
|
|
|
|
|
expect(page).to have_content "Check your changes before updating this scheme" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when changing confirm secondary group answer" do |
|
|
|
|
|
|
|
before do |
|
|
|
|
|
|
|
click_link("Change", href: "/schemes/#{scheme.id}/confirm-secondary-client-group?check_answers=true") |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "allows changing confirm-secondary-client-group question to yes" do |
|
|
|
|
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/confirm-secondary-client-group?check_answers=true") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
choose "Yes" |
|
|
|
|
|
|
|
click_button "Save and continue" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/secondary-client-group?check_answers=true") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
choose "People at risk of domestic violence" |
|
|
|
|
|
|
|
click_button "Save and continue" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/check-answers") |
|
|
|
|
|
|
|
expect(page).to have_content "People at risk of domestic violence" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when I press the back button" do |
|
|
|
|
|
|
|
before do |
|
|
|
|
|
|
|
click_link "Back" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "lets me select the support answers" do |
|
|
|
|
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/check-answers") |
|
|
|
|
|
|
|
expect(page).to have_content "Check your changes before updating this scheme" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when allows changing confirm-secondary-client-group question to no" do |
|
|
|
it "lets me check my answers" do |
|
|
|
before do |
|
|
|
expect(page).to have_content "Check your changes before updating this scheme" |
|
|
|
click_link("Change", href: "/schemes/#{scheme.id}/confirm-secondary-client-group?check_answers=true") |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "allows changing confirm-secondary-client-group question to no" do |
|
|
|
|
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/confirm-secondary-client-group?check_answers=true") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
choose "No" |
|
|
|
|
|
|
|
click_button "Save and continue" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/check-answers") |
|
|
|
|
|
|
|
expect(page).not_to have_content "Secondary client group" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when changing secondary-client-group question" do |
|
|
|
context "and I select to create a scheme" do |
|
|
|
before do |
|
|
|
before do |
|
|
|
click_link("Change", href: "/schemes/#{scheme.id}/secondary-client-group?check_answers=true") |
|
|
|
click_link "Create scheme" |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "allows changing secondary-client-group question" do |
|
|
|
|
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/secondary-client-group?check_answers=true") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
choose "People at risk of domestic violence" |
|
|
|
|
|
|
|
click_button "Save and continue" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/check-answers") |
|
|
|
|
|
|
|
expect(page).to have_content "People at risk of domestic violence" |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when I press the back button" do |
|
|
|
it "adds scheme to the list of schemes" do |
|
|
|
before do |
|
|
|
expect(page).to have_content "Supported housing schemes" |
|
|
|
click_link "Back" |
|
|
|
expect(page).to have_content scheme.id_to_display |
|
|
|
end |
|
|
|
expect(page).to have_content scheme.service_name |
|
|
|
|
|
|
|
expect(page).to have_content scheme.organisation.name |
|
|
|
it "lets me select the support answers" do |
|
|
|
expect(page).to have_content scheme.stock_owning_organisation.name |
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/check-answers") |
|
|
|
expect(page).to have_content "#{scheme.organisation.name} has been created." |
|
|
|
expect(page).to have_content "Check your changes before updating this scheme" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when changing support questions" do |
|
|
|
context "when changing answers" do |
|
|
|
before do |
|
|
|
|
|
|
|
click_link("Change", href: "/schemes/#{scheme.id}/support?check_answers=true", match: :first) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "allows changing support questions" do |
|
|
|
|
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/support?check_answers=true") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
choose "Resettlement support" |
|
|
|
|
|
|
|
choose "Medium stay" |
|
|
|
|
|
|
|
click_button "Save and continue" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/check-answers") |
|
|
|
|
|
|
|
expect(page).to have_content "Resettlement support" |
|
|
|
|
|
|
|
expect(page).to have_content "Medium stay" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when I press the back button" do |
|
|
|
|
|
|
|
before do |
|
|
|
|
|
|
|
click_link "Back" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "lets me select the support answers" do |
|
|
|
|
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/check-answers") |
|
|
|
|
|
|
|
expect(page).to have_content "Check your changes before updating this scheme" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# it "lets me check my answers" do |
|
|
|
|
|
|
|
# expect(page).to have_content "Check your changes before updating this scheme" |
|
|
|
|
|
|
|
# end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|