Browse Source

checking the back functionality for returning to check answers from details page

pull/671/head
JG 3 years ago
parent
commit
6c99800075
  1. 48
      spec/features/schemes_spec.rb

48
spec/features/schemes_spec.rb

@ -365,22 +365,38 @@ RSpec.describe "Schemes scheme Features" do
end end
context "when changing answers" do context "when changing answers" do
it "displays change links" do context "changing details" do
assert_selector "a", text: "Change", count: 12 before do
end click_link("Change", href: "/schemes/#{scheme.id}/details?check_answers=true", match: :first)
end
it "allows changing details questions" do
click_link("Change", href: "/schemes/#{scheme.id}/details?check_answers=true", match: :first) it "displays change links" do
expect(page).to have_current_path("/schemes/#{scheme.id}/details?check_answers=true") assert_selector "a", text: "Change", count: 12
end
fill_in "Scheme name", with: "Example"
choose "Direct access hostel" it "allows changing details questions" do
choose "Yes – registered care home providing nursing care" expect(page).to have_current_path("/schemes/#{scheme.id}/details?check_answers=true")
click_button "Save and continue"
fill_in "Scheme name", with: "Example"
expect(page).to have_current_path("/schemes/#{scheme.id}/check-answers") choose "Direct access hostel"
expect(page).to have_content "Example" choose "Yes – registered care home providing nursing care"
expect(page).to have_content "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 end
it "allows changing primary-client-group question" do it "allows changing primary-client-group question" do

Loading…
Cancel
Save