From acc078a9e1419690036a2d4c0da6d77ea24737fb Mon Sep 17 00:00:00 2001 From: Devin McCurdy <41960449+devin-mccurdy@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:09:21 -0500 Subject: [PATCH] max method length --- .../vaos/v2/appointments_controller.rb | 24 ++++++++++--------- .../requests/vaos/v2/appointments_spec.rb | 1 - 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/modules/vaos/app/controllers/vaos/v2/appointments_controller.rb b/modules/vaos/app/controllers/vaos/v2/appointments_controller.rb index fd80cf462a2..1564e741657 100644 --- a/modules/vaos/app/controllers/vaos/v2/appointments_controller.rb +++ b/modules/vaos/app/controllers/vaos/v2/appointments_controller.rb @@ -347,7 +347,6 @@ def create_method_logging_name end end - # rubocop:disable Metrics/MethodLength def submit_params params.require(%i[id network_id provider_service_id slot_id referral_number]) params.permit( @@ -360,22 +359,25 @@ def submit_params :email, :phone_number, :gender, - address: [ - :type, - { line: [] }, - :city, - :state, - :postal_code, - :country, - :text - ], + address: submit_address_params, name: [ :family, { given: [] } ] ) end - # rubocop:enable Metrics/MethodLength + + def submit_address_params + [ + :type, + { line: [] }, + :city, + :state, + :postal_code, + :country, + :text + ] + end def patient_attributes(params) { diff --git a/modules/vaos/spec/requests/vaos/v2/appointments_spec.rb b/modules/vaos/spec/requests/vaos/v2/appointments_spec.rb index c39553c6281..a073dcc2641 100644 --- a/modules/vaos/spec/requests/vaos/v2/appointments_spec.rb +++ b/modules/vaos/spec/requests/vaos/v2/appointments_spec.rb @@ -933,7 +933,6 @@ def stub_clinics match_requests_on: %i[method path]) do VCR.use_cassette('vaos/v2/eps/post_submit_appointment_400', match_requests_on: %i[method path]) do - params[:phone_number] = nil post '/vaos/v2/appointments/submit', params: { ** params, phone_number: nil }, headers: inflection_header response_obj = JSON.parse(response.body)