From 97bcfc2431dde0a740477b10ab28ea0d51d8eeb3 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Tue, 1 Oct 2024 12:37:00 +0100 Subject: [PATCH] remove building society roll number --- app/controllers/claims_form_callbacks.rb | 9 -- app/forms/bank_details_form.rb | 17 ---- app/forms/bank_or_building_society_form.rb | 39 -------- app/helpers/admin/claims_helper.rb | 2 +- app/models/claim.rb | 15 ---- .../slug_sequence.rb | 5 -- app/models/journeys/base.rb | 2 - app/models/journeys/base_answers_presenter.rb | 9 +- .../slug_sequence.rb | 5 -- .../slug_sequence.rb | 5 -- app/models/journeys/session_answers.rb | 8 -- .../slug_sequence.rb | 4 - app/views/admin/amendments/new.html.erb | 14 --- .../admin/tasks/payroll_details.html.erb | 1 - app/views/claims/_account_details.html.erb | 14 +-- .../claims/bank_or_building_society.html.erb | 21 ----- .../claims/building_society_account.html.erb | 5 +- .../claims/personal_bank_account.html.erb | 2 +- config/locales/en.yml | 20 ++--- spec/features/admin/admin_amend_claim_spec.rb | 4 - spec/features/changing_answers_spec.rb | 37 -------- .../claim_with_mobile_sms_otp_spec.rb | 2 +- .../combined_teacher_claim_journey_spec.rb | 9 +- ...urney_with_teacher_id_check_mobile_spec.rb | 4 - ...cher_claim_journey_with_teacher_id_spec.rb | 4 - .../early_career_payments_claim_spec.rb | 24 ----- .../happy_js_path_spec.rb | 4 - .../happy_path_spec.rb | 4 - .../teacher_route_completing_the_form_spec.rb | 33 ------- spec/features/hmrc_bank_validation_spec.rb | 4 - .../levelling_up_premium_payments_spec.rb | 9 +- spec/features/student_loans_claim_spec.rb | 13 +-- ...urney_with_teacher_id_check_mobile_spec.rb | 4 - ..._claim_journey_with_teacher_id_trn_spec.rb | 5 -- spec/forms/bank_details_form_spec.rb | 29 ------ .../bank_or_building_society_form_spec.rb | 90 ------------------- spec/helpers/admin/claims_helper_spec.rb | 9 -- .../slug_sequence_spec.rb | 16 ---- .../slug_sequence_spec.rb | 16 ---- .../step_helpers.rb | 34 ------- ...urney_answers_presenter_shared_examples.rb | 29 ------ 41 files changed, 17 insertions(+), 563 deletions(-) delete mode 100644 app/forms/bank_or_building_society_form.rb delete mode 100644 app/views/claims/bank_or_building_society.html.erb delete mode 100644 spec/forms/bank_or_building_society_form_spec.rb diff --git a/app/controllers/claims_form_callbacks.rb b/app/controllers/claims_form_callbacks.rb index 49ac10bdb6..3634ba3c16 100644 --- a/app/controllers/claims_form_callbacks.rb +++ b/app/controllers/claims_form_callbacks.rb @@ -27,10 +27,6 @@ def personal_bank_account_before_update inject_hmrc_validation_attempt_count_into_the_form end - def building_society_account_before_update - inject_hmrc_validation_attempt_count_into_the_form - end - def information_provided_before_update return unless journey_requires_student_loan_details? @@ -49,11 +45,6 @@ def personal_bank_account_after_form_save_failure render_template_for_current_slug end - def building_society_account_after_form_save_failure - increment_hmrc_validation_attempt_count if hmrc_api_validation_attempted? - render_template_for_current_slug - end - def postcode_search_after_form_save_failure lookup_failed_error = @form.errors.messages_for(:base).first if lookup_failed_error diff --git a/app/forms/bank_details_form.rb b/app/forms/bank_details_form.rb index 102c48329a..ca4e22473c 100644 --- a/app/forms/bank_details_form.rb +++ b/app/forms/bank_details_form.rb @@ -7,7 +7,6 @@ class BankDetailsForm < Form attribute :banking_name, :string attribute :bank_sort_code, :string attribute :bank_account_number, :string - attribute :building_society_roll_number, :string attr_reader :hmrc_api_validation_attempted, :hmrc_api_validation_succeeded, :hmrc_api_response_error @@ -15,12 +14,9 @@ class BankDetailsForm < Form validates :banking_name, format: {with: BANKING_NAME_REGEX_FILTER, message: i18n_error_message(:invalid_banking_name)}, if: -> { banking_name.present? } validates :bank_sort_code, presence: {message: i18n_error_message(:enter_sort_code)} validates :bank_account_number, presence: {message: i18n_error_message(:enter_account_number)} - validates :building_society_roll_number, presence: {message: i18n_error_message(:enter_roll_number)}, if: -> { answers.building_society? } validate :bank_account_number_must_be_eight_digits validate :bank_sort_code_must_be_six_digits - validate :building_society_roll_number_must_be_between_one_and_eighteen_digits - validate :building_society_roll_number_must_be_in_a_valid_format # This should be the last validation specified to prevent unnecessary API calls validate :bank_account_is_valid @@ -32,7 +28,6 @@ def save banking_name: banking_name, bank_sort_code: normalised_bank_detail(bank_sort_code), bank_account_number: normalised_bank_detail(bank_account_number), - building_society_roll_number: building_society_roll_number, hmrc_bank_validation_succeeded: hmrc_bank_validation_succeeded ) @@ -65,18 +60,6 @@ def bank_sort_code_must_be_six_digits errors.add(:bank_sort_code, i18n_errors_path(:format_sort_code)) if bank_sort_code.present? && normalised_bank_detail(bank_sort_code) !~ /\A\d{6}\z/ end - def building_society_roll_number_must_be_between_one_and_eighteen_digits - return unless building_society_roll_number.present? - - errors.add(:building_society_roll_number, i18n_errors_path(:length_roll_number)) if building_society_roll_number.length > 18 - end - - def building_society_roll_number_must_be_in_a_valid_format - return unless building_society_roll_number.present? - - errors.add(:building_society_roll_number, i18n_errors_path(:format_roll_number)) unless /\A[a-z0-9\-\s.\/]{1,18}\z/i.match?(building_society_roll_number) - end - def bank_account_is_valid return unless can_validate_with_hmrc_api? diff --git a/app/forms/bank_or_building_society_form.rb b/app/forms/bank_or_building_society_form.rb deleted file mode 100644 index b03601c17c..0000000000 --- a/app/forms/bank_or_building_society_form.rb +++ /dev/null @@ -1,39 +0,0 @@ -class BankOrBuildingSocietyForm < Form - attribute :bank_or_building_society - - validates :bank_or_building_society, - inclusion: { - in: Claim.bank_or_building_societies.keys, - message: i18n_error_message(:select_bank_or_building_society) - } - - def save - return false unless valid? - - if bank_or_building_society_changed? - journey_session.answers.assign_attributes( - banking_name: nil, - bank_account_number: nil, - bank_sort_code: nil, - building_society_roll_number: nil - ) - end - - journey_session.answers.assign_attributes(bank_or_building_society:) - - journey_session.save! - end - - def radio_options - [ - OpenStruct.new(id: :personal_bank_account, name: "Personal bank account"), - OpenStruct.new(id: :building_society, name: "Building society") - ] - end - - private - - def bank_or_building_society_changed? - answers.bank_or_building_society != bank_or_building_society - end -end diff --git a/app/helpers/admin/claims_helper.rb b/app/helpers/admin/claims_helper.rb index 2a80382a26..733fe25124 100644 --- a/app/helpers/admin/claims_helper.rb +++ b/app/helpers/admin/claims_helper.rb @@ -227,7 +227,7 @@ def days_between(first_date, second_date) end def code_msg(bank_account_verification_response, claim) - "Error #{bank_account_verification_response.code} - HMRC API failure. No checks have been completed on the claimant’s #{t("admin.#{claim.bank_or_building_society}")} details. Select yes to manually approve the claimant’s #{t("admin.#{claim.bank_or_building_society}")} details" + "Error #{bank_account_verification_response.code} - HMRC API failure. No checks have been completed on the claimant’s bank account details. Select yes to manually approve the claimant’s bank account details" end def sort_code_msg(bank_account_verification_response) diff --git a/app/models/claim.rb b/app/models/claim.rb index 4c0a4e4a0c..10e38dd469 100644 --- a/app/models/claim.rb +++ b/app/models/claim.rb @@ -154,14 +154,11 @@ class Claim < ApplicationRecord validates :bank_sort_code, on: [:amendment], presence: {message: "Enter a sort code"} validates :bank_account_number, on: [:amendment], presence: {message: "Enter an account number"} - validates :building_society_roll_number, on: [:submit, :amendment], presence: {message: "Enter a roll number"}, if: -> { building_society? } validates :payroll_gender, on: [:"payroll-gender-task"], presence: {message: "You must select a gender that will be passed to HMRC"} validate :bank_account_number_must_be_eight_digits validate :bank_sort_code_must_be_six_digits - validate :building_society_roll_number_must_be_between_one_and_eighteen_digits - validate :building_society_roll_number_must_be_in_a_valid_format before_save :normalise_ni_number, if: %i[national_insurance_number national_insurance_number_changed?] before_save :normalise_bank_account_number, if: %i[bank_account_number bank_account_number_changed?] @@ -484,18 +481,6 @@ def normalised_bank_detail(bank_detail) bank_detail.gsub(/\s|-/, "") end - def building_society_roll_number_must_be_between_one_and_eighteen_digits - return unless building_society_roll_number.present? - - errors.add(:building_society_roll_number, "Building society roll number must be between 1 and 18 characters") if building_society_roll_number.length > 18 - end - - def building_society_roll_number_must_be_in_a_valid_format - return unless building_society_roll_number.present? - - errors.add(:building_society_roll_number, "Building society roll number must only include letters a to z, numbers, hyphens, spaces, forward slashes and full stops") unless /\A[a-z0-9\-\s.\/]{1,18}\z/i.match?(building_society_roll_number) - end - def bank_account_number_must_be_eight_digits errors.add(:bank_account_number, "Account number must be 8 digits") if bank_account_number.present? && normalised_bank_detail(bank_account_number) !~ /\A\d{8}\z/ end diff --git a/app/models/journeys/additional_payments_for_teaching/slug_sequence.rb b/app/models/journeys/additional_payments_for_teaching/slug_sequence.rb index 2581ae2f17..24871f9f85 100644 --- a/app/models/journeys/additional_payments_for_teaching/slug_sequence.rb +++ b/app/models/journeys/additional_payments_for_teaching/slug_sequence.rb @@ -50,9 +50,7 @@ class SlugSequence ].freeze PAYMENT_DETAILS_SLUGS = [ - "bank-or-building-society", "personal-bank-account", - "building-society-account", "gender", "teacher-reference-number" ].freeze @@ -124,9 +122,6 @@ def slugs sequence.delete("eligibility-confirmed") unless overall_eligibility_status == :eligible_now sequence.delete("eligible-later") unless overall_eligibility_status == :eligible_later - sequence.delete("personal-bank-account") if answers.building_society? - sequence.delete("building-society-account") if answers.personal_bank_account? - sequence.delete("teacher-reference-number") if answers.logged_in_with_tid? && answers.teacher_reference_number.present? sequence.delete("correct-school") unless journey_session.logged_in_with_tid_and_has_recent_tps_school? diff --git a/app/models/journeys/base.rb b/app/models/journeys/base.rb index b4e9444cd4..b9c2ed9def 100644 --- a/app/models/journeys/base.rb +++ b/app/models/journeys/base.rb @@ -14,9 +14,7 @@ module Base "email-verification" => EmailVerificationForm, "mobile-number" => MobileNumberForm, "mobile-verification" => MobileVerificationForm, - "bank-or-building-society" => BankOrBuildingSocietyForm, "personal-bank-account" => BankDetailsForm, - "building-society-account" => BankDetailsForm, "teacher-reference-number" => TeacherReferenceNumberForm, "address" => AddressForm, "postcode-search" => PostcodeSearchForm, diff --git a/app/models/journeys/base_answers_presenter.rb b/app/models/journeys/base_answers_presenter.rb index 9d390a0537..094970ab68 100644 --- a/app/models/journeys/base_answers_presenter.rb +++ b/app/models/journeys/base_answers_presenter.rb @@ -25,13 +25,10 @@ def identity_answers end def payment_answers - change_slug = answers.building_society? ? "building-society-account" : "personal-bank-account" [].tap do |a| - a << [t("questions.bank_or_building_society"), answers.bank_or_building_society.to_s.humanize, "bank-or-building-society"] - a << ["Name on bank account", answers.banking_name, change_slug] - a << ["Bank sort code", answers.bank_sort_code, change_slug] - a << ["Bank account number", answers.bank_account_number, change_slug] - a << ["Building society roll number", answers.building_society_roll_number, change_slug] if answers.building_society_roll_number.present? + a << ["Name on bank account", answers.banking_name, "personal-bank-account"] + a << ["Bank sort code", answers.bank_sort_code, "personal-bank-account"] + a << ["Bank account number", answers.bank_account_number, "personal-bank-account"] end end diff --git a/app/models/journeys/further_education_payments/slug_sequence.rb b/app/models/journeys/further_education_payments/slug_sequence.rb index 45a8ccc2c3..89dbfec4e6 100644 --- a/app/models/journeys/further_education_payments/slug_sequence.rb +++ b/app/models/journeys/further_education_payments/slug_sequence.rb @@ -42,9 +42,7 @@ class SlugSequence ].freeze PAYMENT_DETAILS_SLUGS = %w[ - bank-or-building-society personal-bank-account - building-society-account gender teacher-reference-number ].freeze @@ -121,9 +119,6 @@ def slugs sequence.delete("mobile-number") sequence.delete("mobile-verification") end - - sequence.delete("personal-bank-account") if answers.building_society? - sequence.delete("building-society-account") if answers.personal_bank_account? end end end diff --git a/app/models/journeys/get_a_teacher_relocation_payment/slug_sequence.rb b/app/models/journeys/get_a_teacher_relocation_payment/slug_sequence.rb index 3974c56afe..fcd22a3c46 100644 --- a/app/models/journeys/get_a_teacher_relocation_payment/slug_sequence.rb +++ b/app/models/journeys/get_a_teacher_relocation_payment/slug_sequence.rb @@ -29,9 +29,7 @@ class SlugSequence ] PAYMENT_DETAILS_SLUGS = [ - "bank-or-building-society", "personal-bank-account", - "building-society-account", "gender" ].freeze @@ -69,9 +67,6 @@ def slugs sequence.delete("mobile-number") sequence.delete("mobile-verification") end - - sequence.delete("personal-bank-account") if answers.building_society? - sequence.delete("building-society-account") if answers.personal_bank_account? end end end diff --git a/app/models/journeys/session_answers.rb b/app/models/journeys/session_answers.rb index 4d2711d9b8..b28c219a47 100644 --- a/app/models/journeys/session_answers.rb +++ b/app/models/journeys/session_answers.rb @@ -77,14 +77,6 @@ def provide_mobile_number? !!provide_mobile_number end - def building_society? - bank_or_building_society == "building_society" - end - - def personal_bank_account? - bank_or_building_society == "personal_bank_account" - end - def hmrc_bank_validation_succeeded? !!hmrc_bank_validation_succeeded end diff --git a/app/models/journeys/teacher_student_loan_reimbursement/slug_sequence.rb b/app/models/journeys/teacher_student_loan_reimbursement/slug_sequence.rb index 4bbb59304b..7ecd19be21 100644 --- a/app/models/journeys/teacher_student_loan_reimbursement/slug_sequence.rb +++ b/app/models/journeys/teacher_student_loan_reimbursement/slug_sequence.rb @@ -42,9 +42,7 @@ class SlugSequence ].freeze PAYMENT_DETAILS_SLUGS = [ - "bank-or-building-society", "personal-bank-account", - "building-society-account", "gender", "teacher-reference-number" ].freeze @@ -82,8 +80,6 @@ def slugs sequence.delete("reset-claim") if skipped_dfe_sign_in? || answers.details_check? sequence.delete("current-school") if answers.employed_at_claim_school? || answers.employed_at_recent_tps_school? sequence.delete("mostly-performed-leadership-duties") unless answers.had_leadership_position? - sequence.delete("personal-bank-account") if answers.building_society? - sequence.delete("building-society-account") if answers.personal_bank_account? sequence.delete("mobile-number") if answers.provide_mobile_number == false sequence.delete("mobile-verification") if answers.provide_mobile_number == false sequence.delete("ineligible") unless ineligible? diff --git a/app/views/admin/amendments/new.html.erb b/app/views/admin/amendments/new.html.erb index 3c36d0dcb9..416d8b8dc0 100644 --- a/app/views/admin/amendments/new.html.erb +++ b/app/views/admin/amendments/new.html.erb @@ -129,20 +129,6 @@ -
-
- <%= form_group_tag(@amendment, :building_society_roll_number) do %> - <%= claim_form.label :building_society_roll_number, class: "govuk-label" %> - <%= errors_tag @amendment, :building_society_roll_number %> - <% end %> -
-
-
- <%= claim_form.text_field :building_society_roll_number, class: "govuk-input govuk-input--width-10" %> -
-
-
-
<%= form_group_tag(@amendment, :address_line_1) do %> diff --git a/app/views/admin/tasks/payroll_details.html.erb b/app/views/admin/tasks/payroll_details.html.erb index 09c0a1db0d..9a4ce9345e 100644 --- a/app/views/admin/tasks/payroll_details.html.erb +++ b/app/views/admin/tasks/payroll_details.html.erb @@ -54,7 +54,6 @@

<%= I18n.t( "admin.tasks.payroll_details.question", - bank_or_building_society: I18n.t("admin.#{@claim.bank_or_building_society}"), claimant_name: @claim.full_name ) %>

diff --git a/app/views/claims/_account_details.html.erb b/app/views/claims/_account_details.html.erb index fcd3827c4b..ea0a4ad6a7 100644 --- a/app/views/claims/_account_details.html.erb +++ b/app/views/claims/_account_details.html.erb @@ -1,6 +1,3 @@ -<% account_hint = bank_or_building_society == "personal bank account" ? "bank" : bank_or_building_society %> -<% account_card = account_hint == "bank" ? account_hint : "" %> - <%= form_for @form, url: claim_path(current_journey_routing_name), builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %> <%= f.govuk_error_summary %> @@ -12,7 +9,7 @@ <%= f.govuk_text_field :banking_name, spellcheck: "false", label: { text: "Name on your account" }, - hint: { text: t("questions.account_hint", bank_or_building_society: account_hint, card: account_card) } %> + hint: { text: t("questions.account_hint") } %> <%= f.govuk_text_field :bank_sort_code, width: "one-quarter", @@ -25,15 +22,6 @@ autocomplete: "off", label: { text: "Account number" }, hint: { text: "For example: 00733445" } %> - - <% if bank_or_building_society == "building society" %> - <%= f.govuk_text_field :building_society_roll_number, - width: 20, - autocomplete: "off", - spellcheck: "false", - label: { text: "Building society roll number" }, - hint: { text: "You can find it on your card, statement or passbook" } %> - <% end %> <% end %> <%= govuk_warning_text(text: t("questions.check_your_account_details")) %> diff --git a/app/views/claims/bank_or_building_society.html.erb b/app/views/claims/bank_or_building_society.html.erb deleted file mode 100644 index 2b1f25a453..0000000000 --- a/app/views/claims/bank_or_building_society.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -<% content_for(:page_title, page_title(t("questions.bank_or_building_society"), journey: current_journey_routing_name, show_error: @form.errors.any?)) %> - -
-
- <%= form_with model: @form, url: claim_path(current_journey_routing_name), builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %> - <%= f.govuk_error_summary %> - - <%= f.govuk_collection_radio_buttons :bank_or_building_society, @form.radio_options, :id, :name, - legend: { - text: t("questions.bank_or_building_society"), - tag: "h1", - size: "l" - }, - hint: { - text: "Some places are both a bank and a building society. If your account requires a roll number your account with them is through the building society." - } %> - - <%= f.govuk_submit "Continue" %> - <% end %> -
-
diff --git a/app/views/claims/building_society_account.html.erb b/app/views/claims/building_society_account.html.erb index b12a31d55e..6e85311bff 100644 --- a/app/views/claims/building_society_account.html.erb +++ b/app/views/claims/building_society_account.html.erb @@ -1,8 +1,7 @@ -<% bank_or_building_society = @form.answers.bank_or_building_society.humanize.downcase %> -<% content_for(:page_title, page_title(t("questions.account_details", bank_or_building_society: bank_or_building_society), journey: current_journey_routing_name, show_error: @form.errors.any?)) %> +<%= content_for(:page_title, page_title(t("questions.account_details", bank_or_building_society: "personal bank account"), journey: current_journey_routing_name, show_error: @form.errors.any?)) %>
- <%= render partial: "account_details", locals: { bank_or_building_society: bank_or_building_society, current_journey_routing_name: current_journey_routing_name} %> + <%= render partial: "account_details", locals: { bank_or_building_society: "personal bank account", current_journey_routing_name: current_journey_routing_name} %>
diff --git a/app/views/claims/personal_bank_account.html.erb b/app/views/claims/personal_bank_account.html.erb index b12a31d55e..fed7a86cbe 100644 --- a/app/views/claims/personal_bank_account.html.erb +++ b/app/views/claims/personal_bank_account.html.erb @@ -1,4 +1,4 @@ -<% bank_or_building_society = @form.answers.bank_or_building_society.humanize.downcase %> +<% bank_or_building_society = "personal bank account" %> <% content_for(:page_title, page_title(t("questions.account_details", bank_or_building_society: bank_or_building_society), journey: current_journey_routing_name, show_error: @form.errors.any?)) %>
diff --git a/config/locales/en.yml b/config/locales/en.yml index fa052ffbf9..45aa5c9110 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -78,9 +78,8 @@ en: personal_details: "Personal details" national_insurance_number: "What is your National Insurance number?" bank_details: "Enter bank account details" - bank_or_building_society: What account do you want the money paid into? - account_details: Enter your %{bank_or_building_society} details - account_hint: "For example: your name as it appears on your %{bank_or_building_society} statement or %{card} card." + account_details: Enter your personal bank account details + account_hint: "For example: your name as it appears on your bank statement or bank card." check_your_account_details: Incorrect details will cause a delay to your payment. check_and_confirm_qualification_details: Check and confirm your qualification details qualification_details: Qualification details @@ -108,7 +107,6 @@ en: teacher_reference_number: "Teacher reference number" national_insurance_number: "National Insurance number" email_address: "Email address" - building_society: "building society" personal_bank_account: "bank account" started_at: "Started at" submitted_at: "Submitted at" @@ -157,8 +155,8 @@ en: student_loan_plan: title: "Check student loan plan" payroll_details: - title: "Check bank/building society account details" - question: "The claimant’s %{bank_or_building_society} details have not been automatically validated. Has the claimant confirmed their %{bank_or_building_society} details?" + title: "Check bank account details" + question: "The claimant’s personal bank account details have not been automatically validated. Has the claimant confirmed their personal bank account details?" census_subjects_taught: title: "Check eligible subjects are taught" visa: @@ -234,17 +232,9 @@ en: enter_roll_number: Enter a roll number format_account_number: Account number must be 8 digits format_sort_code: Sort code must be 6 digits - format_roll_number: - Building society roll number must only include letters a to z, numbers, hyphens, spaces, forward slashes and - full stops invalid_sort_code: Enter a valid sort code invalid_account_number: Enter the account number associated with the name on the account and/or sort code invalid_banking_name: Enter a valid name on the account - length_roll_number: Building society roll number must be between 1 and 18 characters - bank_or_building_society: - errors: - select_bank_or_building_society: - Select if you want the money paid in to a personal bank account or building society address: questions: your_address: What is your address? @@ -892,7 +882,7 @@ en: matching_details: title: Is this claim still valid despite having matching details with other claims? payroll_details: - title: "Check bank/building society account details" + title: "Check bank account details" provider_verification: title: "Has the provider confirmed the claimant's details?" contract_type: diff --git a/spec/features/admin/admin_amend_claim_spec.rb b/spec/features/admin/admin_amend_claim_spec.rb index 2a95b9462b..50b50c2963 100644 --- a/spec/features/admin/admin_amend_claim_spec.rb +++ b/spec/features/admin/admin_amend_claim_spec.rb @@ -46,7 +46,6 @@ select "Plan 2", from: "Student loan repayment plan" fill_in "Bank sort code", with: "111213" fill_in "Bank account number", with: "18929492" - fill_in "Building society roll number", with: "JF 838281" fill_in "Address line 1", with: "New address line 1" fill_in "Address line 2", with: "New address line 2" @@ -66,7 +65,6 @@ "student_loan_plan" => ["plan_1", "plan_2"], "bank_sort_code" => ["010203", "111213"], "bank_account_number" => ["47274828", "18929492"], - "building_society_roll_number" => ["RN 123456", "JF 838281"], "address_line_1" => ["Old address line 1", "New address line 1"], "address_line_2" => ["Old address line 2", "New address line 2"], "address_line_3" => ["Old address line 3", "New address line 3"], @@ -81,7 +79,6 @@ expect(claim.student_loan_plan).to eq("plan_2") expect(claim.bank_sort_code).to eq("111213") expect(claim.bank_account_number).to eq("18929492") - expect(claim.building_society_roll_number).to eq("JF 838281") expect(claim.address_line_1).to eq("New address line 1") expect(claim.address_line_2).to eq("New address line 2") expect(claim.address_line_3).to eq("New address line 3") @@ -99,7 +96,6 @@ expect(page).to have_content("Student loan repayment plan\nchanged from Plan 1 to Plan 2") expect(page).to have_content("Bank sort code\nchanged from 010203 to 111213") expect(page).to have_content("Bank account number\nchanged from 47274828 to 18929492") - expect(page).to have_content("Building society roll number\nchanged from RN 123456 to JF 838281") expect(page).to have_content("Address line 1\nchanged from Old address line 1 to New address line 1") expect(page).to have_content("Address line 2\nchanged from Old address line 2 to New address line 2") diff --git a/spec/features/changing_answers_spec.rb b/spec/features/changing_answers_spec.rb index ce9a7444c8..70f3b133d5 100644 --- a/spec/features/changing_answers_spec.rb +++ b/spec/features/changing_answers_spec.rb @@ -287,43 +287,6 @@ expect(current_path).to eq(claim_path(Journeys::TeacherStudentLoanReimbursement::ROUTING_NAME, "check-your-answers")) expect(journey_session.reload.answers.first_name).to eq("Bobby") end - - scenario "user can change the answer to payment details" do - jump_to_claim_journey_page( - slug: "check-your-answers", - journey_session: journey_session - ) - - expect(page).to have_content(I18n.t("questions.bank_or_building_society")) - expect(page).to have_content("Personal bank account") - - find("a[href='#{claim_path(Journeys::TeacherStudentLoanReimbursement::ROUTING_NAME, "bank-or-building-society")}']").click - - choose "Building society" - click_on "Continue" - - journey_session.reload - expect(page).to have_content(I18n.t("questions.account_details", bank_or_building_society: journey_session.answers.bank_or_building_society.humanize.downcase)) - expect(page).to have_content("Building society roll number") - - expect(journey_session.answers.bank_or_building_society).to eq :building_society.to_s - expect(journey_session.answers.banking_name).to be_nil - expect(journey_session.answers.bank_sort_code).to be_nil - expect(journey_session.answers.bank_account_number).to be_nil - - fill_in "Name on your account", with: "Miss Jasmine Aniski" - fill_in "Sort code", with: "80-78-01" - fill_in "Account number", with: "43290701" - fill_in "Building society roll number", with: "6284/000390713" - - click_on "Continue" - - journey_session.reload - expect(journey_session.answers.banking_name).to eq "Miss Jasmine Aniski" - expect(journey_session.answers.bank_sort_code).to eq "807801" - expect(journey_session.answers.bank_account_number).to eq "43290701" - expect(journey_session.answers.building_society_roll_number).to eq "6284/000390713" - end end describe "Teacher changes a field that requires OTP validation" do diff --git a/spec/features/claim_with_mobile_sms_otp_spec.rb b/spec/features/claim_with_mobile_sms_otp_spec.rb index 468a6087b2..1d3d5a0be9 100644 --- a/spec/features/claim_with_mobile_sms_otp_spec.rb +++ b/spec/features/claim_with_mobile_sms_otp_spec.rb @@ -54,7 +54,7 @@ fill_in "claim-one-time-password-field", with: scenario[:otp_code] click_on "Confirm" - expect(page).to have_text(I18n.t("questions.bank_or_building_society")) + expect(page).to have_text("Enter your personal bank account details") end end end diff --git a/spec/features/combined_teacher_claim_journey_spec.rb b/spec/features/combined_teacher_claim_journey_spec.rb index 2b928172ef..42e6229cf1 100644 --- a/spec/features/combined_teacher_claim_journey_spec.rb +++ b/spec/features/combined_teacher_claim_journey_spec.rb @@ -191,15 +191,8 @@ # - Mobile number one-time password expect(page).not_to have_text("Enter the 6-digit passcode") - # Payment to Bank or Building Society - expect(page).to have_text(I18n.t("questions.bank_or_building_society")) - - choose "Personal bank account" - click_on "Continue" - # - Enter bank account details - expect(page).to have_text(I18n.t("questions.account_details", bank_or_building_society: journey_session.reload.answers.bank_or_building_society.humanize.downcase)) - expect(page).not_to have_text("Building society roll number") + expect(page).to have_text(I18n.t("questions.account_details", bank_or_building_society: "personal bank account")) fill_in "Name on your account", with: "Jo Bloggs" fill_in "Sort code", with: "123456" diff --git a/spec/features/combined_teacher_claim_journey_with_teacher_id_check_mobile_spec.rb b/spec/features/combined_teacher_claim_journey_with_teacher_id_check_mobile_spec.rb index bcb56ef938..7614e4ddb2 100644 --- a/spec/features/combined_teacher_claim_journey_with_teacher_id_check_mobile_spec.rb +++ b/spec/features/combined_teacher_claim_journey_with_teacher_id_check_mobile_spec.rb @@ -171,13 +171,9 @@ def fill_in_remaining_details # - student-loan-amount page click_on "Continue" - choose "Building society" - click_on "Continue" - fill_in "Name on your account", with: "Jo Bloggs" fill_in "Sort code", with: "123456" fill_in "Account number", with: "87654321" - fill_in "Building society roll number", with: "1234/123456789" click_on "Continue" # - What gender does your school's payroll system associate with you diff --git a/spec/features/combined_teacher_claim_journey_with_teacher_id_spec.rb b/spec/features/combined_teacher_claim_journey_with_teacher_id_spec.rb index 04f95b2a34..34ee065a45 100644 --- a/spec/features/combined_teacher_claim_journey_with_teacher_id_spec.rb +++ b/spec/features/combined_teacher_claim_journey_with_teacher_id_spec.rb @@ -155,10 +155,6 @@ choose "01234567890" click_on "Continue" - expect(page).to have_text(I18n.t("questions.bank_or_building_society")) - choose "Personal bank account" - click_on "Continue" - fill_in "Name on your account", with: "John Doe" fill_in "Sort code", with: "123456" fill_in "Account number", with: "87654321" diff --git a/spec/features/early_career_payments/early_career_payments_claim_spec.rb b/spec/features/early_career_payments/early_career_payments_claim_spec.rb index 7a55f6626c..75029a554b 100644 --- a/spec/features/early_career_payments/early_career_payments_claim_spec.rb +++ b/spec/features/early_career_payments/early_career_payments_claim_spec.rb @@ -183,15 +183,8 @@ # - Mobile number one-time password expect(page).not_to have_text("Enter the 6-digit passcode") - # Payment to Bank or Building Society - expect(page).to have_text(I18n.t("questions.bank_or_building_society")) - - choose "Personal bank account" - click_on "Continue" - # - Enter bank account details expect(page).to have_text(I18n.t("questions.account_details", bank_or_building_society: "personal bank account")) - expect(page).not_to have_text("Building society roll number") fill_in "Name on your account", with: "Jo Bloggs" fill_in "Sort code", with: "123456" @@ -243,7 +236,6 @@ expect(claim.postcode).to eq("DE22 4BS") expect(claim.email_address).to eq("david.tau1988@hotmail.co.uk") expect(claim.provide_mobile_number).to eq false - expect(claim.bank_or_building_society).to eq "personal_bank_account" expect(claim.banking_name).to eq("Jo Bloggs") expect(claim.bank_sort_code).to eq("123456") expect(claim.bank_account_number).to eq("87654321") @@ -594,15 +586,8 @@ # - Mobile number one-time password expect(page).not_to have_text("Enter the 6-digit passcode") - # Payment to Bank or Building Society - expect(page).to have_text(I18n.t("questions.bank_or_building_society")) - - choose "Personal bank account" - click_on "Continue" - # - Enter bank account details expect(page).to have_text(I18n.t("questions.account_details", bank_or_building_society: "personal bank account")) - expect(page).not_to have_text("Building society roll number") fill_in "Name on your account", with: "Jo Bloggs" fill_in "Sort code", with: "123456" @@ -654,7 +639,6 @@ expect(claim.address_line_4).to eql("Nottinghamshire") expect(claim.postcode).to eql("M1 7HL") expect(claim.provide_mobile_number).to eql false - expect(claim.bank_or_building_society).to eq "personal_bank_account" expect(claim.banking_name).to eq("Jo Bloggs") expect(claim.bank_sort_code).to eq("123456") expect(claim.bank_account_number).to eq("87654321") @@ -915,15 +899,8 @@ # - Mobile number one-time password expect(page).not_to have_text("Enter the 6-digit passcode") - # Payment to Bank or Building Society - expect(page).to have_text(I18n.t("questions.bank_or_building_society")) - - choose "Personal bank account" - click_on "Continue" - # - Enter bank account details expect(page).to have_text(I18n.t("questions.account_details", bank_or_building_society: "personal bank account")) - expect(page).not_to have_text("Building society roll number") fill_in "Name on your account", with: "Jo Bloggs" fill_in "Sort code", with: "123456" @@ -964,7 +941,6 @@ expect(submitted_claim.postcode).to eql "SO16 9FX" expect(submitted_claim.email_address).to eql("david.tau1988@hotmail.co.uk") expect(submitted_claim.provide_mobile_number).to eql false - expect(submitted_claim.bank_or_building_society).to eq "personal_bank_account" expect(submitted_claim.banking_name).to eq("Jo Bloggs") expect(submitted_claim.bank_sort_code).to eq("123456") expect(submitted_claim.bank_account_number).to eq("87654321") diff --git a/spec/features/further_education_payments/happy_js_path_spec.rb b/spec/features/further_education_payments/happy_js_path_spec.rb index fa6092c687..c9692fcb53 100644 --- a/spec/features/further_education_payments/happy_js_path_spec.rb +++ b/spec/features/further_education_payments/happy_js_path_spec.rb @@ -117,10 +117,6 @@ choose "No" click_on "Continue" - expect(page).to have_content("What account do you want the money paid into?") - choose "Personal bank account" - click_on "Continue" - expect(page).to have_content("Enter your personal bank account details") fill_in "Name on your account", with: "Jo Bloggs" fill_in "Sort code", with: "123456" diff --git a/spec/features/further_education_payments/happy_path_spec.rb b/spec/features/further_education_payments/happy_path_spec.rb index 32392e7c2c..bf6549415e 100644 --- a/spec/features/further_education_payments/happy_path_spec.rb +++ b/spec/features/further_education_payments/happy_path_spec.rb @@ -154,10 +154,6 @@ choose "No" click_on "Continue" - expect(page).to have_content("What account do you want the money paid into?") - choose "Personal bank account" - click_on "Continue" - expect(page).to have_content("Enter your personal bank account details") fill_in "Name on your account", with: "Jo Bloggs" fill_in "Sort code", with: "123456" diff --git a/spec/features/get_a_teacher_relocation_payment/teacher_route_completing_the_form_spec.rb b/spec/features/get_a_teacher_relocation_payment/teacher_route_completing_the_form_spec.rb index 5c23f9aaf5..14e92c8c9d 100644 --- a/spec/features/get_a_teacher_relocation_payment/teacher_route_completing_the_form_spec.rb +++ b/spec/features/get_a_teacher_relocation_payment/teacher_route_completing_the_form_spec.rb @@ -91,26 +91,6 @@ then_the_application_is_submitted_successfully end end - - context "with a building society account" do - it "submits an application" do - and_i_complete_the_nationality_step_with(option: "Australian") - and_i_complete_the_passport_number_step_with(options: "123456789") - and_i_complete_the_personal_details_step - and_i_complete_the_manual_address_step - and_i_complete_the_email_address_step - and_i_provide_my_mobile_number - and_i_provide_my_building_society_details - and_i_complete_the_payroll_gender_step - then_the_check_your_answers_part_page_shows_my_answers( - school, - mobile_number: true, - building_society: true - ) - and_i_submit_the_application - then_the_application_is_submitted_successfully - end - end end def then_the_check_your_answers_part_one_page_shows_my_answers @@ -189,22 +169,9 @@ def then_the_check_your_answers_part_page_shows_my_answers(school, mobile_number end expect(page).to have_text("Name on bank account Walter Skinner") - expect(page).to have_text("Bank sort code 123456") - expect(page).to have_text("Bank account number 12345678") - if building_society - expect(page).to have_text( - "What account do you want the money paid into? Building society" - ) - expect(page).to have_text("Building society roll number 12345678") - else - expect(page).to have_text( - "What account do you want the money paid into? Personal bank account" - ) - end - expect(page).to have_text( "How is your gender recorded on your school’s payroll system? Male" ) diff --git a/spec/features/hmrc_bank_validation_spec.rb b/spec/features/hmrc_bank_validation_spec.rb index fea6f644a8..d391ec3e0f 100644 --- a/spec/features/hmrc_bank_validation_spec.rb +++ b/spec/features/hmrc_bank_validation_spec.rb @@ -102,10 +102,6 @@ def get_to_bank_details_page # - Provide mobile number choose "No" click_on "Continue" - - # Payment to Bank or Building Society - choose "Personal bank account" - click_on "Continue" end context "HMRC API returns a 200 response", :with_stubbed_hmrc_client do diff --git a/spec/features/levelling_up_premium_payments_spec.rb b/spec/features/levelling_up_premium_payments_spec.rb index f361878560..6f27461830 100644 --- a/spec/features/levelling_up_premium_payments_spec.rb +++ b/spec/features/levelling_up_premium_payments_spec.rb @@ -195,14 +195,8 @@ def claim_up_to_check_your_answers # - Mobile number one-time password expect(page).not_to have_text("Enter the 6-digit passcode") - # - Payment to Bank or Building Society - expect(page).to have_text(I18n.t("questions.bank_or_building_society")) - - choose "Personal bank account" - click_on "Continue" - # - Enter bank account details - expect(page).to have_text(I18n.t("questions.account_details", bank_or_building_society: journey_session.reload.answers.bank_or_building_society.humanize.downcase)) + expect(page).to have_text(I18n.t("questions.account_details", bank_or_building_society: "personal bank account")) expect(page).not_to have_text("Building society roll number") fill_in "Name on your account", with: "Jo Bloggs" @@ -250,7 +244,6 @@ def submit_application expect(submitted_claim.postcode).to eql("DE22 4BS") expect(submitted_claim.email_address).to eql("david.tau1988@hotmail.co.uk") expect(submitted_claim.provide_mobile_number).to eql false - expect(submitted_claim.bank_or_building_society).to eq "personal_bank_account" expect(submitted_claim.banking_name).to eq("Jo Bloggs") expect(submitted_claim.bank_sort_code).to eq("123456") expect(submitted_claim.bank_account_number).to eq("87654321") diff --git a/spec/features/student_loans_claim_spec.rb b/spec/features/student_loans_claim_spec.rb index ed306fef27..587b483106 100644 --- a/spec/features/student_loans_claim_spec.rb +++ b/spec/features/student_loans_claim_spec.rb @@ -133,7 +133,6 @@ def fill_in_remaining_personal_details_and_submit # - Provide mobile number expect(page).to have_text(I18n.t("questions.provide_mobile_number")) - choose "No" click_on "Continue" @@ -142,20 +141,11 @@ def fill_in_remaining_personal_details_and_submit # - Mobile number expect(page).not_to have_text(I18n.t("questions.mobile_number")) - expect(page).to have_text(I18n.t("questions.bank_or_building_society")) - - choose "Building society" - click_on "Continue" - - expect(session.reload.answers.bank_or_building_society).to eq "building_society" - - expect(page).to have_text(I18n.t("questions.account_details", bank_or_building_society: session.answers.bank_or_building_society.humanize.downcase)) - expect(page).to have_text("Building society roll number") + expect(page).to have_text("Enter your personal bank account details") fill_in "Name on your account", with: "Jo Bloggs" fill_in "Sort code", with: "123456" fill_in "Account number", with: "87654321" - fill_in "Building society roll number", with: "1234/123456789" click_on "Continue" session.reload @@ -163,7 +153,6 @@ def fill_in_remaining_personal_details_and_submit expect(answers.banking_name).to eq("Jo Bloggs") expect(answers.bank_sort_code).to eq("123456") expect(answers.bank_account_number).to eq("87654321") - expect(answers.building_society_roll_number).to eq("1234/123456789") expect(page).to have_text(I18n.t("forms.gender.questions.payroll_gender")) choose "Male" diff --git a/spec/features/tslr/tslr_claim_journey_with_teacher_id_check_mobile_spec.rb b/spec/features/tslr/tslr_claim_journey_with_teacher_id_check_mobile_spec.rb index 74361bb33b..b5f37abc8a 100644 --- a/spec/features/tslr/tslr_claim_journey_with_teacher_id_check_mobile_spec.rb +++ b/spec/features/tslr/tslr_claim_journey_with_teacher_id_check_mobile_spec.rb @@ -156,13 +156,9 @@ def fill_in_remaining_details # - student-loan-amount page click_on "Continue" - choose "Building society" - click_on "Continue" - fill_in "Name on your account", with: "Jo Bloggs" fill_in "Sort code", with: "123456" fill_in "Account number", with: "87654321" - fill_in "Building society roll number", with: "1234/123456789" click_on "Continue" # - What gender does your school's payroll system associate with you diff --git a/spec/features/tslr/tslr_claim_journey_with_teacher_id_trn_spec.rb b/spec/features/tslr/tslr_claim_journey_with_teacher_id_trn_spec.rb index dc237be2c0..9b1775027f 100644 --- a/spec/features/tslr/tslr_claim_journey_with_teacher_id_trn_spec.rb +++ b/spec/features/tslr/tslr_claim_journey_with_teacher_id_trn_spec.rb @@ -110,14 +110,9 @@ def navigate_to_teacher_reference_number_page(school:) find("#claim_mobile_check_use").click click_on "Continue" - # - Choose bank or building society - choose "Building society" - click_on "Continue" - fill_in "Name on your account", with: "Jo Bloggs" fill_in "Sort code", with: "123456" fill_in "Account number", with: "87654321" - fill_in "Building society roll number", with: "1234/123456789" click_on "Continue" choose "Male" diff --git a/spec/forms/bank_details_form_spec.rb b/spec/forms/bank_details_form_spec.rb index d66f48280f..9dde933ade 100644 --- a/spec/forms/bank_details_form_spec.rb +++ b/spec/forms/bank_details_form_spec.rb @@ -22,7 +22,6 @@ banking_name:, bank_sort_code:, bank_account_number:, - building_society_roll_number:, hmrc_validation_attempt_count: } end @@ -38,7 +37,6 @@ let(:banking_name) { "Jo Bloggs" } let(:bank_sort_code) { rand(100000..999999) } let(:bank_account_number) { rand(10000000..99999999) } - let(:building_society_roll_number) { nil } let(:hmrc_validation_attempt_count) { 0 } describe "#valid?" do @@ -91,33 +89,6 @@ it { is_expected.not_to be_valid } end - context "when building society" do - let(:journey_session) do - create( - :"#{journey::I18N_NAMESPACE}_session", - answers: attributes_for( - :"#{journey::I18N_NAMESPACE}_answers", - bank_or_building_society: "building_society" - ) - ) - end - - context "with valid building society roll number" do - let(:building_society_roll_number) { "CXJ-K6 897/98X" } - it { is_expected.to be_valid } - end - - context "with invalid building society roll number" do - let(:building_society_roll_number) { "123456789/ABC.CD-EFGH " } - it { is_expected.not_to be_valid } - end - - context "with blank building society roll number" do - let(:building_society_roll_number) { "" } - it { is_expected.not_to be_valid } - end - end - context "when HMRC bank validation is enabled", :with_hmrc_bank_validation_enabled do it "contacts the HMRC API" do form.valid? diff --git a/spec/forms/bank_or_building_society_form_spec.rb b/spec/forms/bank_or_building_society_form_spec.rb deleted file mode 100644 index 3be6dfc0d8..0000000000 --- a/spec/forms/bank_or_building_society_form_spec.rb +++ /dev/null @@ -1,90 +0,0 @@ -require "rails_helper" - -RSpec.describe BankOrBuildingSocietyForm, type: :model do - shared_examples "bank_or_building_society_form" do |journey| - before { - create(:journey_configuration, :student_loans) - create(:journey_configuration, :additional_payments) - } - - let(:journey_session) do - create( - :"#{journey::I18N_NAMESPACE}_session", - answers: attributes_for( - :"#{journey::I18N_NAMESPACE}_answers", - :with_bank_details, - building_society_roll_number: "A123456" - ) - ) - end - - let(:slug) { "bank-or-building-society-form" } - let(:claim_params) { {} } - - subject(:form) do - described_class.new( - journey_session: journey_session, - journey: journey, - params: ActionController::Parameters.new({slug:, claim: claim_params}) - ) - end - - describe "validations" do - it { should allow_value(%w[personal_bank_account building_society]).for(:bank_or_building_society).with_message("Select if you want the money paid in to a personal bank account or building society") } - end - - describe "#save" do - context "when submitted with valid params" do - let(:claim_params) { {bank_or_building_society: "personal_bank_account"} } - - it "saves bank_or_building_society" do - expect(form.save).to be true - - expect( - journey_session.reload.answers.bank_or_building_society - ).to eq "personal_bank_account" - end - end - - context "when bank_or_building_society has not changed" do - let(:claim_params) { {bank_or_building_society: "personal_bank_account"} } - - it "doesn't reset dependent answers" do - expect { expect(form.save).to be true }.to( - not_change { journey_session.reload.answers.banking_name }.and( - not_change { journey_session.reload.answers.bank_account_number } - ).and( - not_change { journey_session.reload.answers.bank_sort_code } - ).and( - not_change { journey_session.reload.answers.building_society_roll_number } - ) - ) - end - end - - context "when bank_or_building_society has changed" do - let(:claim_params) { {bank_or_building_society: "building_society"} } - - it "resets dependent answers" do - expect { expect(form.save).to be true }.to( - change { journey_session.reload.answers.banking_name }.to(nil).and( - change { journey_session.reload.answers.bank_account_number }.to(nil) - ).and( - change { journey_session.reload.answers.bank_sort_code }.to(nil) - ).and( - change { journey_session.reload.answers.building_society_roll_number }.to(nil) - ) - ) - end - end - end - end - - describe "for TeacherStudentLoanReimbursement journey" do - include_examples "bank_or_building_society_form", Journeys::TeacherStudentLoanReimbursement - end - - describe "for AdditionalPaymentsForTeaching journey" do - include_examples "bank_or_building_society_form", Journeys::AdditionalPaymentsForTeaching - end -end diff --git a/spec/helpers/admin/claims_helper_spec.rb b/spec/helpers/admin/claims_helper_spec.rb index 628224d9b3..dc65513444 100644 --- a/spec/helpers/admin/claims_helper_spec.rb +++ b/spec/helpers/admin/claims_helper_spec.rb @@ -657,15 +657,6 @@ expect(code_msg(bank_account_verification_response, claim)).to eq "Error 400 - HMRC API failure. No checks have been completed on the claimant’s bank account details. Select yes to manually approve the claimant’s bank account details" end end - - context "429 error with building society" do - let(:claim) { create(:claim, :submitted, bank_or_building_society: :building_society) } - let(:bank_account_verification_response) { Hmrc::BankAccountVerificationResponse.new(OpenStruct.new({code: 429, body: {}.to_json})) } - - it "returns message with code and bank account" do - expect(code_msg(bank_account_verification_response, claim)).to eq "Error 429 - HMRC API failure. No checks have been completed on the claimant’s building society details. Select yes to manually approve the claimant’s building society details" - end - end end describe "#sort_code_msg" do diff --git a/spec/models/journeys/additional_payments_for_teaching/slug_sequence_spec.rb b/spec/models/journeys/additional_payments_for_teaching/slug_sequence_spec.rb index c583945c73..3b12f02512 100644 --- a/spec/models/journeys/additional_payments_for_teaching/slug_sequence_spec.rb +++ b/spec/models/journeys/additional_payments_for_teaching/slug_sequence_spec.rb @@ -324,22 +324,6 @@ end end - context "when claim payment details are 'personal bank account'" do - it "excludes the 'building-society-account' slug" do - journey_session.answers.bank_or_building_society = :personal_bank_account - - expect(slug_sequence.slugs).not_to include("building-society-account") - end - end - - context "when claim payment details are 'building society'" do - it "excludes the 'personal-bank-account' slug" do - journey_session.answers.bank_or_building_society = :building_society - - expect(slug_sequence.slugs).not_to include("personal-bank-account") - end - end - context "when Teacher ID is disabled on the policy configuration" do let(:teacher_id_enabled) { false } diff --git a/spec/models/journeys/teacher_student_loan_reimbursement/slug_sequence_spec.rb b/spec/models/journeys/teacher_student_loan_reimbursement/slug_sequence_spec.rb index a7ee49df7d..32382dfc45 100644 --- a/spec/models/journeys/teacher_student_loan_reimbursement/slug_sequence_spec.rb +++ b/spec/models/journeys/teacher_student_loan_reimbursement/slug_sequence_spec.rb @@ -44,22 +44,6 @@ expect(slug_sequence.slugs).not_to include("current-school") end - context "when claim payment details are 'personal bank account'" do - it "excludes the 'building-society-account' slug" do - journey_session.answers.bank_or_building_society = :personal_bank_account - - expect(slug_sequence.slugs).not_to include("building-society-account") - end - end - - context "when claim payment details are 'building society'" do - it "excludes the 'personal-bank-account' slug" do - journey_session.answers.bank_or_building_society = :building_society - - expect(slug_sequence.slugs).not_to include("personal-bank-account") - end - end - context "when 'provide_mobile_number' is 'No'" do it "excludes the 'mobile-number' slug" do journey_session.answers.provide_mobile_number = false diff --git a/spec/support/get_a_teacher_relocation_payment/step_helpers.rb b/spec/support/get_a_teacher_relocation_payment/step_helpers.rb index fe41031663..d2a69683b3 100644 --- a/spec/support/get_a_teacher_relocation_payment/step_helpers.rb +++ b/spec/support/get_a_teacher_relocation_payment/step_helpers.rb @@ -225,12 +225,6 @@ def and_i_provide_my_mobile_number end def and_i_provide_my_personal_bank_details - assert_on_bank_or_building_society_page! - - choose "Personal bank account" - - click_button("Continue") - assert_on_personal_bank_account_page! fill_in("Name on your account", with: "Walter Skinner") @@ -242,26 +236,6 @@ def and_i_provide_my_personal_bank_details click_button("Continue") end - def and_i_provide_my_building_society_details - assert_on_bank_or_building_society_page! - - choose "Building society" - - click_button("Continue") - - assert_on_building_society_account_page! - - fill_in "Name on your account", with: "Walter Skinner" - - fill_in("Sort code", with: "123456") - - fill_in("Account number", with: "12345678") - - fill_in("Building society roll number", with: "12345678") - - click_button("Continue") - end - def and_i_complete_the_payroll_gender_step assert_on_payroll_gender_step! @@ -350,18 +324,10 @@ def assert_on_provider_mobile_number_page! expect(page).to have_text("Would you like to provide your mobile number?") end - def assert_on_bank_or_building_society_page! - expect(page).to have_text("What account do you want the money paid into?") - end - def assert_on_personal_bank_account_page! expect(page).to have_text("Enter your personal bank account details") end - def assert_on_building_society_account_page! - expect(page).to have_text("Enter your building society details") - end - def assert_on_payroll_gender_step! expect(page).to have_text( "How is your gender recorded on your school’s payroll system?" diff --git a/spec/support/journey_answers_presenter_shared_examples.rb b/spec/support/journey_answers_presenter_shared_examples.rb index b083fe102c..5a44291df8 100644 --- a/spec/support/journey_answers_presenter_shared_examples.rb +++ b/spec/support/journey_answers_presenter_shared_examples.rb @@ -186,7 +186,6 @@ create( :additional_payments_session, answers: { - bank_or_building_society: "personal_bank_account", bank_sort_code: "123456", bank_account_number: "12345678", banking_name: "Jo Bloggs" @@ -199,7 +198,6 @@ context "when a personal bank account is selected" do it "returns an array of questions and answers for displaying to the user for review" do expected_answers = [ - [I18n.t("questions.bank_or_building_society"), "Personal bank account", "bank-or-building-society"], ["Name on bank account", "Jo Bloggs", "personal-bank-account"], ["Bank sort code", "123456", "personal-bank-account"], ["Bank account number", "12345678", "personal-bank-account"] @@ -208,32 +206,5 @@ expect(answers).to eq expected_answers end end - - context "when a building society is selected" do - let(:journey_session) do - create( - :additional_payments_session, - answers: { - bank_or_building_society: "building_society", - bank_sort_code: "659007", - bank_account_number: "90770224", - banking_name: "David Badger-Hillary", - building_society_roll_number: "5890/87654321" - } - ) - end - - it "returns an array of questions and answers for displaying to the user for review" do - expected_answers = [ - [I18n.t("questions.bank_or_building_society"), "Building society", "bank-or-building-society"], - ["Name on bank account", "David Badger-Hillary", "building-society-account"], - ["Bank sort code", "659007", "building-society-account"], - ["Bank account number", "90770224", "building-society-account"], - ["Building society roll number", "5890/87654321", "building-society-account"] - ] - - expect(answers).to eq expected_answers - end - end end end