Browse Source

tests: update tests

pull/1173/head
natdeanlewissoftwire 3 years ago
parent
commit
473f49072d
  1. 12
      spec/features/schemes_spec.rb
  2. 1
      spec/requests/schemes_controller_spec.rb

12
spec/features/schemes_spec.rb

@ -617,8 +617,6 @@ RSpec.describe "Schemes scheme Features" do
context "when changing scheme answers" do context "when changing scheme answers" do
before 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_primary_client_group
fill_in_and_save_secondary_client_group_confirmation_yes fill_in_and_save_secondary_client_group_confirmation_yes
fill_in_and_save_secondary_client_group fill_in_and_save_secondary_client_group
@ -626,7 +624,7 @@ RSpec.describe "Schemes scheme Features" do
end end
it "displays change links" do it "displays change links" do
assert_selector "a", text: "Change", count: 13 assert_selector "a", text: "Change", count: 12
end end
it "allows changing details questions" do 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" expect(page).to have_content "Check your changes before creating this scheme"
end end
it "keeps the provider answer when swithing between other provider options" do it "keeps the provider answer when switching between other provider options" do
click_link("Change", href: "/schemes/#{scheme.id}/details?check_answers=true", match: :first) click_link("Change", href: "/schemes/#{scheme.id}/confirm-secondary-client-group?check_answers=true", match: :first)
choose "Another organisation" choose "Yes"
click_button "Save and continue" 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 end
it "does not display the answer if it's changed to the same support provider" do it "does not display the answer if it's changed to the same support provider" do

1
spec/requests/schemes_controller_spec.rb

@ -582,6 +582,7 @@ RSpec.describe SchemesController, type: :request do
{ scheme: { service_name: "", { scheme: { service_name: "",
scheme_type: "", scheme_type: "",
registered_under_care_act: "", registered_under_care_act: "",
owning_organisation_id: nil,
arrangement_type: "" } } arrangement_type: "" } }
end end

Loading…
Cancel
Save