diff --git a/spec/features/schemes_spec.rb b/spec/features/schemes_spec.rb index 713fca2ac..3d43f7c48 100644 --- a/spec/features/schemes_spec.rb +++ b/spec/features/schemes_spec.rb @@ -281,8 +281,7 @@ RSpec.describe "Schemes scheme Features" do context "when we amend scheme details" do it "returns to the primary client group question" do click_button "Save and continue" - expect(page).to have_content "What client group is this scheme intended for?" - end + expect(page).to have_current_path("/schemes/#{scheme.id}/primary-client-group") end end end @@ -305,6 +304,12 @@ RSpec.describe "Schemes scheme Features" do expect(page).to have_current_path("/schemes/#{scheme.id}/primary-client-group") expect(page).to have_content "What client group is this scheme intended for?" end + + context "when we amend primary client group" do + it "returns to the confirm secondary client group question" do + click_button "Save and continue" + expect(page).to have_current_path("/schemes/#{scheme.id}/confirm-secondary-client-group") end + end end context "when I confirm the secondary group" do @@ -326,6 +331,12 @@ RSpec.describe "Schemes scheme Features" do expect(page).to have_current_path("/schemes/#{scheme.id}/confirm-secondary-client-group") expect(page).to have_content "Does this scheme provide for another client group?" end + + context "when we amend confirm secondary client" do + it "returns to the secondary client group question" do + click_button "Save and continue" + expect(page).to have_current_path("/schemes/#{scheme.id}/secondary-client-group") end + end end context "when I select the secondary group" do @@ -347,6 +358,12 @@ RSpec.describe "Schemes scheme Features" do expect(page).to have_current_path("/schemes/#{scheme.id}/secondary-client-group") expect(page).to have_content "What is the other client group?" end + + context "when we amend secondary client" do + it "returns to the support question" do + click_button "Save and continue" + expect(page).to have_current_path("/schemes/#{scheme.id}/support") end + end end context "when I select the support answers" do