Browse Source

Add more tests for back button

pull/671/head
Kat 3 years ago committed by JG
parent
commit
aec198e7cf
  1. 21
      spec/features/schemes_spec.rb

21
spec/features/schemes_spec.rb

@ -281,8 +281,7 @@ RSpec.describe "Schemes scheme Features" do
context "when we amend scheme details" do context "when we amend scheme details" do
it "returns to the primary client group question" do it "returns to the primary client group question" do
click_button "Save and continue" click_button "Save and continue"
expect(page).to have_content "What client group is this scheme intended for?" expect(page).to have_current_path("/schemes/#{scheme.id}/primary-client-group") end
end
end 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_current_path("/schemes/#{scheme.id}/primary-client-group")
expect(page).to have_content "What client group is this scheme intended for?" expect(page).to have_content "What client group is this scheme intended for?"
end 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 end
context "when I confirm the secondary group" do 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_current_path("/schemes/#{scheme.id}/confirm-secondary-client-group")
expect(page).to have_content "Does this scheme provide for another client group?" expect(page).to have_content "Does this scheme provide for another client group?"
end 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 end
context "when I select the secondary group" do 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_current_path("/schemes/#{scheme.id}/secondary-client-group")
expect(page).to have_content "What is the other client group?" expect(page).to have_content "What is the other client group?"
end 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 end
context "when I select the support answers" do context "when I select the support answers" do

Loading…
Cancel
Save