From 473f49072dfac4df8d144e74e5c545238a8b303b Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Wed, 11 Jan 2023 12:03:06 +0000 Subject: [PATCH] tests: update tests --- spec/features/schemes_spec.rb | 12 +++++------- spec/requests/schemes_controller_spec.rb | 1 + 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/spec/features/schemes_spec.rb b/spec/features/schemes_spec.rb index 92d618ca5..9a39b9283 100644 --- a/spec/features/schemes_spec.rb +++ b/spec/features/schemes_spec.rb @@ -617,8 +617,6 @@ RSpec.describe "Schemes scheme Features" do context "when changing scheme answers" do before do - select another_organisation.name, from: "scheme-managing-organisation-id-field" - click_button "Save and continue" fill_in_and_save_primary_client_group fill_in_and_save_secondary_client_group_confirmation_yes fill_in_and_save_secondary_client_group @@ -626,7 +624,7 @@ RSpec.describe "Schemes scheme Features" do end it "displays change links" do - assert_selector "a", text: "Change", count: 13 + assert_selector "a", text: "Change", count: 12 end it "allows changing details questions" do @@ -647,11 +645,11 @@ RSpec.describe "Schemes scheme Features" do expect(page).to have_content "Check your changes before creating this scheme" end - it "keeps the provider answer when swithing between other provider options" do - click_link("Change", href: "/schemes/#{scheme.id}/details?check_answers=true", match: :first) - choose "Another organisation" + it "keeps the provider answer when switching between other provider options" do + click_link("Change", href: "/schemes/#{scheme.id}/confirm-secondary-client-group?check_answers=true", match: :first) + choose "Yes" click_button "Save and continue" - expect(page).to have_content(another_organisation.name) + expect(find_field("Offenders and people at risk of offending")).to be_checked end it "does not display the answer if it's changed to the same support provider" do diff --git a/spec/requests/schemes_controller_spec.rb b/spec/requests/schemes_controller_spec.rb index 7d8e7b595..257ea6ec2 100644 --- a/spec/requests/schemes_controller_spec.rb +++ b/spec/requests/schemes_controller_spec.rb @@ -582,6 +582,7 @@ RSpec.describe SchemesController, type: :request do { scheme: { service_name: "", scheme_type: "", registered_under_care_act: "", + owning_organisation_id: nil, arrangement_type: "" } } end