From e8564ad978aa82c9204ab379e80161b7da9ba129 Mon Sep 17 00:00:00 2001 From: Andrew Herzberg Date: Thu, 1 Jun 2023 09:58:04 -0700 Subject: [PATCH] move mobile cassettes to root spec folder (#12847) * move mobile cassettes to root * lint fix --- .../application_controller_spec.rb | 2 +- .../profile_base_controller_spec.rb | 4 +- .../spec/request/addresses_request_spec.rb | 51 ++++---- .../appointments_cancel_request_spec.rb | 15 +-- .../appointments_create_request_spec.rb | 21 ++-- .../appointments_preferences_request_spec.rb | 15 +-- .../appointments_vaos_v2_list_request_spec.rb | 54 ++++----- .../spec/request/attachments_request_spec.rb | 4 +- ...laims_and_appeals_overview_request_spec.rb | 31 ++--- .../request/claims_decision_request_spec.rb | 2 +- .../request/claims_document_upload_spec.rb | 2 +- .../spec/request/clinics_request_spec.rb | 21 ++-- ...community_care_eligibility_request_spec.rb | 15 +-- .../community_care_providers_request_spec.rb | 33 +++--- .../request/decision_letters_request_spec.rb | 10 +- .../request/disability_rating_request_spec.rb | 53 ++++----- .../spec/request/discovery_request_spec.rb | 2 +- .../spec/request/emails_request_spec.rb | 27 ++--- .../request/facilities_info_request_spec.rb | 27 ++--- .../facility_eligibility_request_spec.rb | 21 ++-- .../spec/request/folders_request_spec.rb | 4 +- .../request/gender_identity_request_spec.rb | 2 +- .../request/immunizations_request_spec.rb | 31 +++-- .../request/individual_appeal_request_spec.rb | 2 +- .../request/individual_claim_request_spec.rb | 2 +- ...ndividual_lighthouse_claim_request_spec.rb | 13 +- .../request/legacy_letters_request_spec.rb | 2 +- .../spec/request/letters_request_spec.rb | 2 +- .../spec/request/locations_request_spec.rb | 21 ++-- .../maintenance_windows_request_spec.rb | 2 +- .../request/message_drafts_request_spec.rb | 4 +- .../spec/request/messages_request_spec.rb | 4 +- .../military_information_request_spec.rb | 17 +-- .../request/payment_history_request_spec.rb | 31 +++-- .../payment_information_request_spec.rb | 11 +- .../spec/request/phones_request_spec.rb | 27 ++--- .../request/preferred_name_request_spec.rb | 4 +- .../request/prescriptions_request_spec.rb | 53 ++++----- .../request/push_get_prefs_request_spec.rb | 2 +- .../request/push_register_request_spec.rb | 2 +- .../spec/request/push_send_request_spec.rb | 2 +- .../request/push_set_pref_request_spec.rb | 2 +- .../spec/request/triage_teams_request_spec.rb | 4 +- .../mobile/spec/request/user_request_spec.rb | 112 +++++++++--------- .../request/v1/immunizations_request_spec.rb | 48 ++++---- .../spec/request/v1/messages_request_spec.rb | 4 +- .../spec/request/v1/user_request_spec.rb | 107 ++++++++--------- ...terans_affairs_eligibility_request_spec.rb | 19 ++- .../lighthouse_health_service_spec.rb | 14 +-- .../spec/services/sync_update_service_spec.rb | 35 +++--- .../{ => helpers}/iam_session_helper.rb | 6 +- .../{ => helpers}/mobile_sm_client_helper.rb | 2 +- .../{ => helpers}/sis_session_helper.rb | 0 .../pre_cache_appointments_job_spec.rb | 26 ++-- .../pre_cache_claims_and_appeals_job_spec.rb | 18 ++- .../spec/workers/vet360_linking_spec.rb | 19 +-- .../vcr_cassettes/mobile}/appeals/appeals.yml | 0 .../mobile}/appeals/server_error.yml | 0 .../VAOS_v2/cancel_appointment_200.yml | 0 .../VAOS_v2/cancel_appointment_400.yml | 0 .../VAOS_v2/cancel_appointment_500.yml | 0 .../VAOS_v2/get_all_appointment_200_ruben.yml | 0 .../VAOS_v2/get_appointment_200.yml | 0 .../get_appointment_200_bad_facility_id.yml | 0 .../get_appointment_200_partial_error.yml | 0 .../get_appointments_no_requests_200.yml | 0 ...appointments_with_mixed_provider_types.yml | 0 .../appointments/VAOS_v2/get_clinic_200.yml | 0 .../get_clinic_bad_facility_id_500.yml | 0 .../appointments/VAOS_v2/get_facility_200.yml | 0 .../appointments/VAOS_v2/get_facility_400.yml | 0 .../appointments/VAOS_v2/get_facility_500.yml | 0 .../get_appointments_cache_false.yml | 0 .../appointments/get_available_slots_200.yml | 0 ..._available_slots_200_no_start_end_date.yml | 0 .../appointments/get_available_slots_500.yml | 0 .../mobile}/appointments/get_facilities.yml | 0 .../appointments/get_facility_clinics_200.yml | 0 ...t_facility_clinics_bad_facility_id_200.yml | 0 .../get_facility_clinics_bad_service_400.yml | 0 .../get_multiple_facilities_200.yml | 0 .../get_multiple_mfs_facilities_200.yml | 0 .../mobile}/appointments/get_preferences.yml | 0 ...acy_get_facilities_for_facilities_info.yml | 0 .../appointments/post_appointments_400.yml | 0 .../post_appointments_cc_200_2222022.yml | 0 ...ppointments_va_booked_200_JACQUELINE_M.yml | 0 ...st_appointments_va_proposed_clinic_200.yml | 0 .../mobile}/appointments/put_preferences.yml | 0 .../put_preferences_minimal_payload.yml | 0 .../cc_eligibility/get_eligibility_400.yml | 0 .../cc_eligibility/get_eligibility_false.yml | 0 .../cc_eligibility/get_eligibility_true.yml | 0 .../vcr_cassettes/mobile}/claims/claims.yml | 0 .../mobile}/claims/claims_with_errors.yml | 0 .../ppms/community_clinics_empty_search.yml | 0 .../ppms/community_clinics_near_facility.yml | 0 .../ppms/community_clinics_near_user.yml | 0 ...ient_appointment_metadata_bad_facility.yml | 0 ...ient_appointment_metadata_facility_100.yml | 0 ...ient_appointment_metadata_facility_101.yml | 0 ...ient_appointment_metadata_facility_102.yml | 0 ...ient_appointment_metadata_facility_103.yml | 0 .../lighthouse_claims/index/200_response.yml | 0 .../lighthouse_claims/index/404_response.yml | 0 .../lighthouse_claims/show/200_response.yml | 0 .../lighthouse_claims/show/404_response.yml | 0 .../get_facilities_empty.yml | 0 .../lighthouse_health/get_facility.yml | 0 .../lighthouse_health/get_immunizations.yml | 0 .../get_immunizations_blank_group_name.yml | 0 .../get_immunizations_blank_note.yml | 0 .../get_immunizations_cached_token.yml | 0 .../get_immunizations_cvx_code_missing.yml | 0 .../get_immunizations_date_missing.yml | 0 .../get_immunizations_no_entry.yml | 0 .../lighthouse_health/get_lh_location.yml | 0 .../lighthouse_health/get_lh_location_404.yml | 0 .../get_lh_location_no_identifier.yml | 0 .../retrieve_payment_summary_with_bdn.yml | 0 ...ve_payment_summary_with_bdn_blank_date.yml | 0 ...ment_summary_with_bdn_only_blank_dates.yml | 0 .../payment_information.yml | 0 ...ent_information_unauthorized_to_update.yml | 0 .../payment_information/service_error_500.yml | 0 .../payment_information/service_error_502.yml | 0 .../mobile}/profile/delete_email_initial.yml | 0 .../mobile}/profile/delete_phone_initial.yml | 0 .../profile/get_address_status_complete.yml | 0 .../profile/get_address_status_error.yml | 0 .../profile/get_address_status_incomplete.yml | 0 .../get_address_status_incomplete_2.yml | 0 .../get_address_transaction_status.yml | 0 .../profile/get_email_status_complete.yml | 0 .../profile/get_email_status_incomplete.yml | 0 .../profile/get_phone_status_complete.yml | 0 .../profile/get_phone_status_incomplete.yml | 0 .../profile/init_vet360_id_status_400.yml | 0 .../init_vet360_id_status_complete.yml | 0 .../init_vet360_id_status_incomplete.yml | 0 .../profile/init_vet360_id_success.yml | 0 .../mobile}/profile/post_address_initial.yml | 0 .../mobile}/profile/post_email_initial.yml | 0 .../mobile}/profile/post_phone_initial.yml | 0 .../mobile}/profile/put_address_initial.yml | 0 .../mobile}/profile/put_address_success.yml | 0 .../mobile}/profile/put_email_initial.yml | 0 .../mobile}/profile/put_phone_initial.yml | 0 .../mobile}/profile/rated_disabilities.yml | 0 .../profile/rated_disabilities_400.yml | 0 .../profile/rated_disabilities_401.yml | 0 .../profile/rated_disabilities_403.yml | 0 .../profile/rated_disabilities_500.yml | 0 ...d_disabilities_mixed_service_connected.yml | 0 .../mobile}/profile/rating_info.yml | 0 .../mobile}/profile/rating_info_400.yml | 0 .../mobile}/profile/rating_info_403.yml | 0 .../mobile}/profile/rating_info_500.yml | 0 .../mobile}/providers/get_provider_200.yml | 0 .../mobile}/providers/get_provider_400.yml | 0 .../mobile}/providers/get_provider_500.yml | 0 .../gets_a_list_of_all_prescriptions.yml | 0 .../gets_optimistic_locking_error.yml | 0 .../gets_tracking_for_a_prescription.yml | 0 ...racking_with_empty_other_prescriptions.yml | 0 .../prescriptions/handles_failed_stations.yml | 0 .../prescription_refill_error.yml | 0 .../prescriptions/refills_prescriptions.yml | 0 .../refills_prescriptions_not_found.yml | 0 .../refills_prescriptions_with_error.yml | 0 ...lls_prescriptions_with_multiple_errors.yml | 0 .../prescriptions/tracking_error_id.yml | 0 .../mobile}/user/get_facilities.yml | 0 .../mobile}/user/get_facilities_empty.yml | 0 .../mobile}/user/get_facilities_no_ids.yml | 0 .../get_scheduling_configurations_200.yml | 0 ...eduling_configurations_200_all_enabled.yml | 0 ...duling_configurations_200_bad_facility.yml | 0 .../va_profile/demographics/demographics.yml | 0 .../va_profile/demographics/logingov.yml | 0 .../post_read_service_histories_200.yml | 0 ...read_service_histories_200_no_end_date.yml | 0 .../post_read_service_history_200.yml | 0 .../post_read_service_history_200_empty.yml | 0 184 files changed, 443 insertions(+), 621 deletions(-) rename modules/mobile/spec/support/{ => helpers}/iam_session_helper.rb (85%) rename modules/mobile/spec/support/{ => helpers}/mobile_sm_client_helper.rb (93%) rename modules/mobile/spec/support/{ => helpers}/sis_session_helper.rb (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appeals/appeals.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appeals/server_error.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/VAOS_v2/cancel_appointment_200.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/VAOS_v2/cancel_appointment_400.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/VAOS_v2/cancel_appointment_500.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/VAOS_v2/get_all_appointment_200_ruben.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/VAOS_v2/get_appointment_200.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/VAOS_v2/get_appointment_200_bad_facility_id.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/VAOS_v2/get_appointment_200_partial_error.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/VAOS_v2/get_appointments_no_requests_200.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/VAOS_v2/get_appointments_with_mixed_provider_types.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/VAOS_v2/get_clinic_200.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/VAOS_v2/get_clinic_bad_facility_id_500.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/VAOS_v2/get_facility_200.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/VAOS_v2/get_facility_400.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/VAOS_v2/get_facility_500.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/get_appointments_cache_false.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/get_available_slots_200.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/get_available_slots_200_no_start_end_date.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/get_available_slots_500.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/get_facilities.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/get_facility_clinics_200.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/get_facility_clinics_bad_facility_id_200.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/get_facility_clinics_bad_service_400.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/get_multiple_facilities_200.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/get_multiple_mfs_facilities_200.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/get_preferences.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/legacy_get_facilities_for_facilities_info.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/post_appointments_400.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/post_appointments_cc_200_2222022.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/post_appointments_va_booked_200_JACQUELINE_M.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/post_appointments_va_proposed_clinic_200.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/put_preferences.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/appointments/put_preferences_minimal_payload.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/cc_eligibility/get_eligibility_400.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/cc_eligibility/get_eligibility_false.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/cc_eligibility/get_eligibility_true.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/claims/claims.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/claims/claims_with_errors.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/facilities/ppms/community_clinics_empty_search.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/facilities/ppms/community_clinics_near_facility.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/facilities/ppms/community_clinics_near_user.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/facility_eligibility/get_patient_appointment_metadata_bad_facility.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/facility_eligibility/get_patient_appointment_metadata_facility_100.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/facility_eligibility/get_patient_appointment_metadata_facility_101.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/facility_eligibility/get_patient_appointment_metadata_facility_102.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/facility_eligibility/get_patient_appointment_metadata_facility_103.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/lighthouse_claims/index/200_response.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/lighthouse_claims/index/404_response.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/lighthouse_claims/show/200_response.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/lighthouse_claims/show/404_response.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/lighthouse_health/get_facilities_empty.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/lighthouse_health/get_facility.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/lighthouse_health/get_immunizations.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/lighthouse_health/get_immunizations_blank_group_name.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/lighthouse_health/get_immunizations_blank_note.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/lighthouse_health/get_immunizations_cached_token.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/lighthouse_health/get_immunizations_cvx_code_missing.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/lighthouse_health/get_immunizations_date_missing.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/lighthouse_health/get_immunizations_no_entry.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/lighthouse_health/get_lh_location.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/lighthouse_health/get_lh_location_404.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/lighthouse_health/get_lh_location_no_identifier.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/payment_history/retrieve_payment_summary_with_bdn.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/payment_history/retrieve_payment_summary_with_bdn_blank_date.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/payment_history/retrieve_payment_summary_with_bdn_only_blank_dates.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/payment_information/payment_information.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/payment_information/payment_information_unauthorized_to_update.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/payment_information/service_error_500.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/payment_information/service_error_502.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/delete_email_initial.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/delete_phone_initial.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/get_address_status_complete.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/get_address_status_error.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/get_address_status_incomplete.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/get_address_status_incomplete_2.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/get_address_transaction_status.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/get_email_status_complete.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/get_email_status_incomplete.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/get_phone_status_complete.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/get_phone_status_incomplete.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/init_vet360_id_status_400.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/init_vet360_id_status_complete.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/init_vet360_id_status_incomplete.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/init_vet360_id_success.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/post_address_initial.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/post_email_initial.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/post_phone_initial.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/put_address_initial.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/put_address_success.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/put_email_initial.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/put_phone_initial.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/rated_disabilities.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/rated_disabilities_400.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/rated_disabilities_401.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/rated_disabilities_403.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/rated_disabilities_500.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/rated_disabilities_mixed_service_connected.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/rating_info.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/rating_info_400.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/rating_info_403.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/profile/rating_info_500.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/providers/get_provider_200.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/providers/get_provider_400.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/providers/get_provider_500.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/rx_refill/prescriptions/gets_a_list_of_all_prescriptions.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/rx_refill/prescriptions/gets_optimistic_locking_error.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/rx_refill/prescriptions/gets_tracking_for_a_prescription.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/rx_refill/prescriptions/gets_tracking_with_empty_other_prescriptions.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/rx_refill/prescriptions/handles_failed_stations.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/rx_refill/prescriptions/prescription_refill_error.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/rx_refill/prescriptions/refills_prescriptions.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/rx_refill/prescriptions/refills_prescriptions_not_found.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/rx_refill/prescriptions/refills_prescriptions_with_error.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/rx_refill/prescriptions/refills_prescriptions_with_multiple_errors.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/rx_refill/prescriptions/tracking_error_id.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/user/get_facilities.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/user/get_facilities_empty.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/user/get_facilities_no_ids.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/va_eligibility/get_scheduling_configurations_200.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/va_eligibility/get_scheduling_configurations_200_all_enabled.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/va_eligibility/get_scheduling_configurations_200_bad_facility.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/va_profile/demographics/demographics.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/va_profile/demographics/logingov.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/va_profile/post_read_service_histories_200.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/va_profile/post_read_service_histories_200_no_end_date.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/va_profile/post_read_service_history_200.yml (100%) rename {modules/mobile/spec/support/vcr_cassettes => spec/support/vcr_cassettes/mobile}/va_profile/post_read_service_history_200_empty.yml (100%) diff --git a/modules/mobile/spec/controllers/application_controller_spec.rb b/modules/mobile/spec/controllers/application_controller_spec.rb index edad1a0416e..f34673d3817 100644 --- a/modules/mobile/spec/controllers/application_controller_spec.rb +++ b/modules/mobile/spec/controllers/application_controller_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' RSpec.describe Mobile::ApplicationController, type: :controller do controller do diff --git a/modules/mobile/spec/controllers/profile_base_controller_spec.rb b/modules/mobile/spec/controllers/profile_base_controller_spec.rb index 17721d3bb8f..5aeea60073b 100644 --- a/modules/mobile/spec/controllers/profile_base_controller_spec.rb +++ b/modules/mobile/spec/controllers/profile_base_controller_spec.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/sis_session_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/sis_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.shared_examples 'sso logging' do |type| diff --git a/modules/mobile/spec/request/addresses_request_spec.rb b/modules/mobile/spec/request/addresses_request_spec.rb index 2e2244aa95e..2639c1ab0f6 100644 --- a/modules/mobile/spec/request/addresses_request_spec.rb +++ b/modules/mobile/spec/request/addresses_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'address', type: :request do @@ -20,19 +20,12 @@ end describe 'update endpoints' do - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - describe 'POST /mobile/v0/user/addresses' do context 'with a valid address that takes two tries to complete' do before do - VCR.use_cassette('profile/get_address_status_complete') do - VCR.use_cassette('profile/get_address_status_incomplete') do - VCR.use_cassette('profile/post_address_initial') do + VCR.use_cassette('mobile/profile/get_address_status_complete') do + VCR.use_cassette('mobile/profile/get_address_status_incomplete') do + VCR.use_cassette('mobile/profile/post_address_initial') do post '/mobile/v0/user/addresses', params: address.to_json, headers: iam_headers(json_body_headers) end end @@ -58,10 +51,10 @@ allow_any_instance_of(Mobile::V0::Profile::SyncUpdateService) .to receive(:seconds_elapsed_since).and_return(61) - VCR.use_cassette('profile/get_address_status_complete') do - VCR.use_cassette('profile/get_address_status_incomplete_2') do - VCR.use_cassette('profile/get_address_status_incomplete') do - VCR.use_cassette('profile/post_address_initial') do + VCR.use_cassette('mobile/profile/get_address_status_complete') do + VCR.use_cassette('mobile/profile/get_address_status_incomplete_2') do + VCR.use_cassette('mobile/profile/get_address_status_incomplete') do + VCR.use_cassette('mobile/profile/post_address_initial') do post '/mobile/v0/user/addresses', params: address.to_json, headers: iam_headers(json_body_headers) end end @@ -109,9 +102,9 @@ describe 'PUT /mobile/v0/user/addresses' do context 'with a valid address that takes two tries to complete' do before do - VCR.use_cassette('profile/get_address_status_complete') do - VCR.use_cassette('profile/get_address_status_incomplete') do - VCR.use_cassette('profile/put_address_initial') do + VCR.use_cassette('mobile/profile/get_address_status_complete') do + VCR.use_cassette('mobile/profile/get_address_status_incomplete') do + VCR.use_cassette('mobile/profile/put_address_initial') do put '/mobile/v0/user/addresses', params: address.to_json, headers: iam_headers(json_body_headers) end end @@ -137,10 +130,10 @@ allow_any_instance_of(Mobile::V0::Profile::SyncUpdateService) .to receive(:seconds_elapsed_since).and_return(61) - VCR.use_cassette('profile/get_address_status_complete') do - VCR.use_cassette('profile/get_address_status_incomplete_2') do - VCR.use_cassette('profile/get_address_status_incomplete') do - VCR.use_cassette('profile/put_address_initial') do + VCR.use_cassette('mobile/profile/get_address_status_complete') do + VCR.use_cassette('mobile/profile/get_address_status_incomplete_2') do + VCR.use_cassette('mobile/profile/get_address_status_incomplete') do + VCR.use_cassette('mobile/profile/put_address_initial') do put '/mobile/v0/user/addresses', params: address.to_json, headers: iam_headers(json_body_headers) end end @@ -188,9 +181,9 @@ describe 'DELETE /mobile/v0/user/addresses' do context 'with a valid address that takes two tries to complete' do before do - VCR.use_cassette('profile/get_address_status_complete') do - VCR.use_cassette('profile/get_address_status_incomplete') do - VCR.use_cassette('profile/put_address_initial') do + VCR.use_cassette('mobile/profile/get_address_status_complete') do + VCR.use_cassette('mobile/profile/get_address_status_incomplete') do + VCR.use_cassette('mobile/profile/put_address_initial') do delete '/mobile/v0/user/addresses', params: address.to_json, headers: iam_headers(json_body_headers) end end @@ -216,10 +209,10 @@ allow_any_instance_of(Mobile::V0::Profile::SyncUpdateService) .to receive(:seconds_elapsed_since).and_return(61) - VCR.use_cassette('profile/get_address_status_complete') do - VCR.use_cassette('profile/get_address_status_incomplete_2') do - VCR.use_cassette('profile/get_address_status_incomplete') do - VCR.use_cassette('profile/put_address_initial') do + VCR.use_cassette('mobile/profile/get_address_status_complete') do + VCR.use_cassette('mobile/profile/get_address_status_incomplete_2') do + VCR.use_cassette('mobile/profile/get_address_status_incomplete') do + VCR.use_cassette('mobile/profile/put_address_initial') do delete '/mobile/v0/user/addresses', params: address.to_json, headers: iam_headers(json_body_headers) end end diff --git a/modules/mobile/spec/request/appointments_cancel_request_spec.rb b/modules/mobile/spec/request/appointments_cancel_request_spec.rb index fdb378b4f01..9d8ad24f071 100644 --- a/modules/mobile/spec/request/appointments_cancel_request_spec.rb +++ b/modules/mobile/spec/request/appointments_cancel_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'appointments', type: :request do @@ -13,18 +13,11 @@ allow_any_instance_of(VAOS::UserService).to receive(:session).and_return('stubbed_token') end - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - describe 'PUT /mobile/v0/appointments/cancel', :aggregate_failures do let(:cancel_id) { '70060' } it 'returns a no content code' do - VCR.use_cassette('appointments/VAOS_v2/cancel_appointment_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/VAOS_v2/cancel_appointment_200', match_requests_on: %i[method uri]) do put "/mobile/v0/appointments/cancel/#{cancel_id}", params: nil, headers: iam_headers expect(response).to have_http_status(:no_content) @@ -34,7 +27,7 @@ context 'when the appointment cannot be found' do it 'returns a 400 code' do - VCR.use_cassette('appointments/VAOS_v2/cancel_appointment_400', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/VAOS_v2/cancel_appointment_400', match_requests_on: %i[method uri]) do put "/mobile/v0/appointments/cancel/#{cancel_id}", params: nil, headers: iam_headers expect(response.status).to eq(400) @@ -48,7 +41,7 @@ context 'when the backend service cannot handle the request' do it 'returns a 502 code' do - VCR.use_cassette('appointments/VAOS_v2/cancel_appointment_500', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/VAOS_v2/cancel_appointment_500', match_requests_on: %i[method uri]) do put "/mobile/v0/appointments/cancel/#{cancel_id}", params: nil, headers: iam_headers expect(response.status).to eq(502) expect(JSON.parse(response.body)['errors'][0]['code']).to eq('VAOS_502') diff --git a/modules/mobile/spec/request/appointments_create_request_spec.rb b/modules/mobile/spec/request/appointments_create_request_spec.rb index 2daf92c739e..25a5c1677c7 100644 --- a/modules/mobile/spec/request/appointments_create_request_spec.rb +++ b/modules/mobile/spec/request/appointments_create_request_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' require 'mobile/v0/vaos_appointments/appointments_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'vaos appointments', type: :request, skip_mvi: true do @@ -27,14 +27,7 @@ # rubocop:enable Layout/LineLength end - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - after(:all) do - VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } - Flipper.disable('va_online_scheduling') end @@ -52,13 +45,14 @@ it 'clears the cache' do expect(Mobile::V0::Appointment).to receive(:clear_cache).once - VCR.use_cassette('appointments/post_appointments_va_proposed_clinic_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/post_appointments_va_proposed_clinic_200', + match_requests_on: %i[method uri]) do post '/mobile/v0/appointment', params: va_proposed_request_body, headers: iam_headers end end it 'returns a descriptive 400 error when given invalid params' do - VCR.use_cassette('appointments/post_appointments_400', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/post_appointments_400', match_requests_on: %i[method uri]) do post '/mobile/v0/appointment', params: {}, headers: iam_headers expect(response).to have_http_status(:bad_request) expect(JSON.parse(response.body)['errors'][0]['status']).to eq('400') @@ -70,7 +64,7 @@ context 'for CC facility' do it 'creates the cc appointment' do - VCR.use_cassette('appointments/post_appointments_cc_200_2222022', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/post_appointments_cc_200_2222022', match_requests_on: %i[method uri]) do post '/mobile/v0/appointment', params: community_cares_request_body, headers: iam_headers expect(response).to have_http_status(:created) expect(json_body_for(response)).to match_camelized_schema('vaos/v2/appointment', { strict: false }) @@ -80,7 +74,8 @@ context 'for va facility' do it 'creates the va appointment - proposed' do - VCR.use_cassette('appointments/post_appointments_va_proposed_clinic_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/post_appointments_va_proposed_clinic_200', + match_requests_on: %i[method uri]) do post '/mobile/v0/appointment', params: {}, headers: iam_headers expect(response).to have_http_status(:created) @@ -89,7 +84,7 @@ end it 'creates the va appointment - booked' do - VCR.use_cassette('appointments/post_appointments_va_booked_200_JACQUELINE_M', + VCR.use_cassette('mobile/appointments/post_appointments_va_booked_200_JACQUELINE_M', match_requests_on: %i[method uri]) do post '/mobile/v0/appointment', params: {}, headers: iam_headers expect(response).to have_http_status(:created) diff --git a/modules/mobile/spec/request/appointments_preferences_request_spec.rb b/modules/mobile/spec/request/appointments_preferences_request_spec.rb index 0bb1d5a13fd..951b03a4913 100644 --- a/modules/mobile/spec/request/appointments_preferences_request_spec.rb +++ b/modules/mobile/spec/request/appointments_preferences_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'appointment preferences', type: :request do @@ -14,16 +14,9 @@ allow_any_instance_of(VAOS::UserService).to receive(:session).and_return('stubbed_token') end - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - describe 'GET /appointments/preferences', :aggregate_failures do it 'returns a 200 with the correct schema' do - VCR.use_cassette('appointments/get_preferences', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/get_preferences', match_requests_on: %i[method uri]) do get '/mobile/v0/appointments/preferences', headers: iam_headers expect(response).to have_http_status(:ok) @@ -50,7 +43,7 @@ end it 'returns a 200 code' do - VCR.use_cassette('appointments/put_preferences', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/put_preferences', match_requests_on: %i[method uri]) do put '/mobile/v0/appointments/preferences', headers: iam_headers, params: request_body expect(response).to have_http_status(:ok) @@ -60,7 +53,7 @@ context 'when only required fields are included in params' do it 'returns a 200 code' do - VCR.use_cassette('appointments/put_preferences_minimal_payload', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/put_preferences_minimal_payload', match_requests_on: %i[method uri]) do put '/mobile/v0/appointments/preferences', headers: iam_headers, params: request_body expect(response).to have_http_status(:ok) diff --git a/modules/mobile/spec/request/appointments_vaos_v2_list_request_spec.rb b/modules/mobile/spec/request/appointments_vaos_v2_list_request_spec.rb index 4b8585297f9..fb97108ac58 100644 --- a/modules/mobile/spec/request/appointments_vaos_v2_list_request_spec.rb +++ b/modules/mobile/spec/request/appointments_vaos_v2_list_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'vaos v2 appointments', type: :request do @@ -13,11 +13,6 @@ allow_any_instance_of(VAOS::UserService).to receive(:session).and_return('stubbed_token') end - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - let(:mock_clinic) do mock_clinic = { service_name: 'Friendly Name Optometry' @@ -56,8 +51,6 @@ end end - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - describe 'GET /mobile/v0/appointments' do before do Timecop.freeze(Time.zone.parse('2022-01-01T19:25:00Z')) @@ -75,8 +68,8 @@ before { mock_clinic } it 'location is populated' do - VCR.use_cassette('appointments/VAOS_v2/get_facility_200', match_requests_on: %i[method uri]) do - VCR.use_cassette('appointments/VAOS_v2/get_appointment_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/VAOS_v2/get_facility_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/VAOS_v2/get_appointment_200', match_requests_on: %i[method uri]) do get '/mobile/v0/appointments', headers: iam_headers, params: end end @@ -106,8 +99,8 @@ end it 'location is nil' do - VCR.use_cassette('appointments/VAOS_v2/get_facility_500', match_requests_on: %i[method uri]) do - VCR.use_cassette('appointments/VAOS_v2/get_appointment_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/VAOS_v2/get_facility_500', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/VAOS_v2/get_appointment_200', match_requests_on: %i[method uri]) do get '/mobile/v0/appointments', headers: iam_headers, params: end end @@ -120,8 +113,8 @@ before { mock_facility } it 'healthcareService is populated' do - VCR.use_cassette('appointments/VAOS_v2/get_clinic_200', match_requests_on: %i[method uri]) do - VCR.use_cassette('appointments/VAOS_v2/get_appointment_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/VAOS_v2/get_clinic_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/VAOS_v2/get_appointment_200', match_requests_on: %i[method uri]) do get '/mobile/v0/appointments', headers: iam_headers, params: end end @@ -134,8 +127,9 @@ before { mock_facility } it 'healthcareService is nil' do - VCR.use_cassette('appointments/VAOS_v2/get_clinic_bad_facility_id_500', match_requests_on: %i[method uri]) do - VCR.use_cassette('appointments/VAOS_v2/get_appointment_200_bad_facility_id', + VCR.use_cassette('mobile/appointments/VAOS_v2/get_clinic_bad_facility_id_500', + match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/VAOS_v2/get_appointment_200_bad_facility_id', match_requests_on: %i[method uri]) do get '/mobile/v0/appointments', headers: iam_headers, params: end @@ -152,7 +146,7 @@ end it 'returned appointment is identical to VAOS v0 version' do - VCR.use_cassette('appointments/VAOS_v2/get_appointment_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/VAOS_v2/get_appointment_200', match_requests_on: %i[method uri]) do get '/mobile/v0/appointments', headers: iam_headers, params: end appt_v0_cancelled = JSON.parse(File.read(Rails.root.join('modules', 'mobile', 'spec', 'support', @@ -169,7 +163,7 @@ end it 'has access and returned va appointments having partial errors' do - VCR.use_cassette('appointments/VAOS_v2/get_appointment_200_partial_error', + VCR.use_cassette('mobile/appointments/VAOS_v2/get_appointment_200_partial_error', match_requests_on: %i[method uri]) do get '/mobile/v0/appointments', headers: iam_headers, params: end @@ -195,8 +189,9 @@ let(:params) { { page: { number: 1, size: 100 }, startDate: start_date, endDate: end_date } } it 'returns no appointment requests' do - VCR.use_cassette('appointments/VAOS_v2/get_all_appointment_200_ruben', match_requests_on: %i[method uri]) do - VCR.use_cassette('providers/get_provider_200', match_requests_on: %i[method uri], tag: :force_utf8) do + VCR.use_cassette('mobile/appointments/VAOS_v2/get_all_appointment_200_ruben', + match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/providers/get_provider_200', match_requests_on: %i[method uri], tag: :force_utf8) do get '/mobile/v0/appointments', headers: iam_headers, params: end end @@ -227,8 +222,9 @@ end it 'processes appointments without error' do - VCR.use_cassette('appointments/VAOS_v2/get_all_appointment_200_ruben', match_requests_on: %i[method uri]) do - VCR.use_cassette('providers/get_provider_200', match_requests_on: %i[method uri], tag: :force_utf8) do + VCR.use_cassette('mobile/appointments/VAOS_v2/get_all_appointment_200_ruben', + match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/providers/get_provider_200', match_requests_on: %i[method uri], tag: :force_utf8) do get '/mobile/v0/appointments', headers: iam_headers, params: end end @@ -256,9 +252,9 @@ end def fetch_appointments - VCR.use_cassette('appointments/VAOS_v2/get_appointments_with_mixed_provider_types', + VCR.use_cassette('mobile/appointments/VAOS_v2/get_appointments_with_mixed_provider_types', match_requests_on: %i[method uri]) do - VCR.use_cassette('providers/get_provider_200', match_requests_on: %i[method uri], tag: :force_utf8) do + VCR.use_cassette('mobile/providers/get_provider_200', match_requests_on: %i[method uri], tag: :force_utf8) do get '/mobile/v0/appointments', headers: iam_headers end end @@ -281,9 +277,10 @@ def fetch_appointments end it 'falls back to nil when provider does not return provider data' do - VCR.use_cassette('appointments/VAOS_v2/get_appointments_with_mixed_provider_types', + VCR.use_cassette('mobile/appointments/VAOS_v2/get_appointments_with_mixed_provider_types', match_requests_on: %i[method uri]) do - VCR.use_cassette('providers/get_provider_400', match_requests_on: %i[method uri], tag: :force_utf8) do + VCR.use_cassette('mobile/providers/get_provider_400', match_requests_on: %i[method uri], + tag: :force_utf8) do get '/mobile/v0/appointments', headers: iam_headers end end @@ -292,9 +289,10 @@ def fetch_appointments end it 'falls back to nil when provider service returns 500' do - VCR.use_cassette('appointments/VAOS_v2/get_appointments_with_mixed_provider_types', + VCR.use_cassette('mobile/appointments/VAOS_v2/get_appointments_with_mixed_provider_types', match_requests_on: %i[method uri]) do - VCR.use_cassette('providers/get_provider_500', match_requests_on: %i[method uri], tag: :force_utf8) do + VCR.use_cassette('mobile/providers/get_provider_500', match_requests_on: %i[method uri], + tag: :force_utf8) do get '/mobile/v0/appointments', headers: iam_headers end end diff --git a/modules/mobile/spec/request/attachments_request_spec.rb b/modules/mobile/spec/request/attachments_request_spec.rb index e3e5fce039a..cd4c85bf898 100644 --- a/modules/mobile/spec/request/attachments_request_spec.rb +++ b/modules/mobile/spec/request/attachments_request_spec.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' -require_relative '../support/mobile_sm_client_helper' +require_relative '../support/helpers/iam_session_helper' +require_relative '../support/helpers/mobile_sm_client_helper' RSpec.describe 'Mobile Message Attachments Integration', type: :request do include Mobile::MessagingClientHelper diff --git a/modules/mobile/spec/request/claims_and_appeals_overview_request_spec.rb b/modules/mobile/spec/request/claims_and_appeals_overview_request_spec.rb index af577cd237f..0868a0cf64b 100644 --- a/modules/mobile/spec/request/claims_and_appeals_overview_request_spec.rb +++ b/modules/mobile/spec/request/claims_and_appeals_overview_request_spec.rb @@ -1,18 +1,18 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' require 'lighthouse/benefits_claims/configuration' require 'lighthouse/benefits_claims/service' RSpec.shared_examples 'claims and appeals overview' do |lighthouse_flag| let(:good_claims_response_vcr_path) do - lighthouse_flag ? 'lighthouse_claims/index/200_response' : 'claims/claims' + lighthouse_flag ? 'mobile/lighthouse_claims/index/200_response' : 'mobile/claims/claims' end let(:error_claims_response_vcr_path) do - lighthouse_flag ? 'lighthouse_claims/index/404_response' : 'claims/claims_with_errors' + lighthouse_flag ? 'mobile/lighthouse_claims/index/404_response' : 'mobile/claims/claims_with_errors' end before do @@ -40,7 +40,7 @@ describe '#index (all user claims) is polled' do it 'and a result that matches our schema is successfully returned with the 200 status ' do VCR.use_cassette(good_claims_response_vcr_path) do - VCR.use_cassette('appeals/appeals') do + VCR.use_cassette('mobile/appeals/appeals') do get('/mobile/v0/claims-and-appeals-overview', headers: iam_headers, params:) expect(response).to have_http_status(:ok) # check a couple entries to make sure the data is correct @@ -87,7 +87,7 @@ it 'and invalid headers return a 401 status' do VCR.use_cassette(good_claims_response_vcr_path) do - VCR.use_cassette('appeals/appeals') do + VCR.use_cassette('mobile/appeals/appeals') do get '/mobile/v0/claims-and-appeals-overview' expect(response).to have_http_status(:unauthorized) expect(response.body).to match_json_schema('evss_errors') @@ -105,7 +105,7 @@ it 'and the results are for page 2 of a 12 item pages which only has 10 entries' do VCR.use_cassette(good_claims_response_vcr_path) do - VCR.use_cassette('appeals/appeals') do + VCR.use_cassette('mobile/appeals/appeals') do get('/mobile/v0/claims-and-appeals-overview', headers: iam_headers, params:) expect(response).to have_http_status(:ok) @@ -127,7 +127,7 @@ it 'and the results contain only closed records' do VCR.use_cassette(good_claims_response_vcr_path) do - VCR.use_cassette('appeals/appeals') do + VCR.use_cassette('mobile/appeals/appeals') do get('/mobile/v0/claims-and-appeals-overview', headers: iam_headers, params:) expect(response).to have_http_status(:ok) # check a couple entries to make sure the data is correct @@ -150,7 +150,7 @@ it 'and the results contain only open records' do VCR.use_cassette(good_claims_response_vcr_path) do - VCR.use_cassette('appeals/appeals') do + VCR.use_cassette('mobile/appeals/appeals') do get('/mobile/v0/claims-and-appeals-overview', headers: iam_headers, params:) expect(response).to have_http_status(:ok) # check a couple entries to make sure the data is correct @@ -169,7 +169,7 @@ it 'and claims service fails, but appeals succeeds' do VCR.use_cassette(error_claims_response_vcr_path) do - VCR.use_cassette('appeals/appeals') do + VCR.use_cassette('mobile/appeals/appeals') do get('/mobile/v0/claims-and-appeals-overview', headers: iam_headers, params:) parsed_response_contents = response.parsed_body['data'] @@ -193,7 +193,7 @@ it 'and appeals service fails, but claims succeeds' do VCR.use_cassette(good_claims_response_vcr_path) do - VCR.use_cassette('appeals/server_error') do + VCR.use_cassette('mobile/appeals/server_error') do get('/mobile/v0/claims-and-appeals-overview', headers: iam_headers, params:) expect(response).to have_http_status(:multi_status) parsed_response_contents = response.parsed_body['data'] @@ -219,7 +219,7 @@ it 'both fail in upstream service' do VCR.use_cassette(error_claims_response_vcr_path) do - VCR.use_cassette('appeals/server_error') do + VCR.use_cassette('mobile/appeals/server_error') do get('/mobile/v0/claims-and-appeals-overview', headers: iam_headers, params:) expect(response).to have_http_status(:bad_gateway) expect(response.parsed_body.dig('meta', 'errors').length).to eq(2) @@ -239,7 +239,7 @@ allow_any_instance_of(IAMUser).to receive(:loa).and_raise(NoMethodError) end VCR.use_cassette(good_claims_response_vcr_path) do - VCR.use_cassette('appeals/appeals') do + VCR.use_cassette('mobile/appeals/appeals') do get('/mobile/v0/claims-and-appeals-overview', headers: iam_headers, params:) expect(response.parsed_body['data'].size).to eq( @@ -282,13 +282,6 @@ RSpec.describe 'claims and appeals overview', type: :request do include JsonSchemaMatchers - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - it_behaves_like 'claims and appeals overview', false it_behaves_like 'claims and appeals overview', true end diff --git a/modules/mobile/spec/request/claims_decision_request_spec.rb b/modules/mobile/spec/request/claims_decision_request_spec.rb index 976108252cd..9f5219a414f 100644 --- a/modules/mobile/spec/request/claims_decision_request_spec.rb +++ b/modules/mobile/spec/request/claims_decision_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' RSpec.describe 'claims decision request', type: :request do describe 'GET /v0/claim/:id/request-decision' do diff --git a/modules/mobile/spec/request/claims_document_upload_spec.rb b/modules/mobile/spec/request/claims_document_upload_spec.rb index 6e80e7e1789..47a3b6ec491 100644 --- a/modules/mobile/spec/request/claims_document_upload_spec.rb +++ b/modules/mobile/spec/request/claims_document_upload_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'claims document upload', type: :request do diff --git a/modules/mobile/spec/request/clinics_request_spec.rb b/modules/mobile/spec/request/clinics_request_spec.rb index 9dddedd7880..70db0915ccf 100644 --- a/modules/mobile/spec/request/clinics_request_spec.rb +++ b/modules/mobile/spec/request/clinics_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'clinics', type: :request do @@ -13,20 +13,13 @@ allow_any_instance_of(VAOS::UserService).to receive(:session).and_return('stubbed_token') end - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - describe 'PUT /mobile/v0/appointments/facilities/:facility_id/clinics', :aggregate_failures do context 'when both facility id and service type is found' do let(:facility_id) { '983' } let(:params) { { service_type: 'audiology' } } it 'returns 200' do - VCR.use_cassette('appointments/get_facility_clinics_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/get_facility_clinics_200', match_requests_on: %i[method uri]) do get "/mobile/v0/appointments/facilities/#{facility_id}/clinics", params:, headers: iam_headers expect(response).to have_http_status(:ok) @@ -40,7 +33,7 @@ let(:params) { { service_type: 'audiology' } } it 'returns 200 with empty response' do - VCR.use_cassette('appointments/get_facility_clinics_bad_facility_id_200', + VCR.use_cassette('mobile/appointments/get_facility_clinics_bad_facility_id_200', match_requests_on: %i[method uri]) do get "/mobile/v0/appointments/facilities/#{facility_id}/clinics", params:, headers: iam_headers @@ -55,7 +48,7 @@ let(:params) { { service_type: 'badservice' } } it 'returns bad request' do - VCR.use_cassette('appointments/get_facility_clinics_bad_service_400', + VCR.use_cassette('mobile/appointments/get_facility_clinics_bad_service_400', match_requests_on: %i[method uri]) do get "/mobile/v0/appointments/facilities/#{facility_id}/clinics", params:, headers: iam_headers @@ -74,7 +67,7 @@ let(:params) { { start_date: '2021-10-26T00:00:00Z', end_date: '2021-12-30T23:59:59Z' } } it 'returns 200' do - VCR.use_cassette('appointments/get_available_slots_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/get_available_slots_200', match_requests_on: %i[method uri]) do get "/mobile/v0/appointments/facilities/#{facility_id}/clinics/#{clinic_id}/slots", params:, headers: iam_headers @@ -98,7 +91,7 @@ end it 'defaults time from now to 2 months from now' do - VCR.use_cassette('appointments/get_available_slots_200_no_start_end_date', + VCR.use_cassette('mobile/appointments/get_available_slots_200_no_start_end_date', match_requests_on: %i[method uri]) do get "/mobile/v0/appointments/facilities/#{facility_id}/clinics/#{clinic_id}/slots", headers: iam_headers @@ -120,7 +113,7 @@ let(:params) { { start_date: '2021-10-01T00:00:00Z', end_date: '2021-12-31T23:59:59Z' } } it 'returns a 502 error' do - VCR.use_cassette('appointments/get_available_slots_500', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/get_available_slots_500', match_requests_on: %i[method uri]) do get "/mobile/v0/appointments/facilities/#{facility_id}/clinics/#{clinic_id}/slots", params:, headers: iam_headers diff --git a/modules/mobile/spec/request/community_care_eligibility_request_spec.rb b/modules/mobile/spec/request/community_care_eligibility_request_spec.rb index 26d194e3f86..0150f459e44 100644 --- a/modules/mobile/spec/request/community_care_eligibility_request_spec.rb +++ b/modules/mobile/spec/request/community_care_eligibility_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'Community Care Eligibility', type: :request do @@ -9,13 +9,6 @@ let(:rsa_key) { OpenSSL::PKey::RSA.generate(2048) } - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - before do allow_any_instance_of(IAMUser).to receive(:icn).and_return('9000682') iam_sign_in(build(:iam_user)) @@ -29,7 +22,7 @@ before do allow(Rails.logger).to receive(:info) - VCR.use_cassette('cc_eligibility/get_eligibility_true', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/cc_eligibility/get_eligibility_true', match_requests_on: %i[method uri]) do get "/mobile/v0/appointments/community_care/eligibility/#{service_type}", headers: iam_headers end end @@ -52,7 +45,7 @@ let(:service_type) { 'optometry' } before do - VCR.use_cassette('cc_eligibility/get_eligibility_false', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/cc_eligibility/get_eligibility_false', match_requests_on: %i[method uri]) do get "/mobile/v0/appointments/community_care/eligibility/#{service_type}", headers: iam_headers end end @@ -76,7 +69,7 @@ let(:service_type) { 'NotAType' } before do - VCR.use_cassette('cc_eligibility/get_eligibility_400', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/cc_eligibility/get_eligibility_400', match_requests_on: %i[method uri]) do get "/mobile/v0/appointments/community_care/eligibility/#{service_type}", headers: iam_headers end end diff --git a/modules/mobile/spec/request/community_care_providers_request_spec.rb b/modules/mobile/spec/request/community_care_providers_request_spec.rb index bbcc96eef58..7aa2555d3d5 100644 --- a/modules/mobile/spec/request/community_care_providers_request_spec.rb +++ b/modules/mobile/spec/request/community_care_providers_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'community care providers', type: :request do @@ -13,15 +13,8 @@ let(:json_body_headers) { { 'Content-Type' => 'application/json', 'Accept' => 'application/json' } } describe 'GET providers', :aggregate_failures do - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - it 'returns 200 with paginated results' do - VCR.use_cassette('facilities/ppms/community_clinics_near_user', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/facilities/ppms/community_clinics_near_user', match_requests_on: %i[method uri]) do params = { serviceType: 'podiatry' } get('/mobile/v0/community-care-providers', headers: iam_headers, params:) @@ -31,7 +24,7 @@ end it 'matches schema' do - VCR.use_cassette('facilities/ppms/community_clinics_near_user', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/facilities/ppms/community_clinics_near_user', match_requests_on: %i[method uri]) do params = { serviceType: 'podiatry' } get('/mobile/v0/community-care-providers', headers: iam_headers, params:) @@ -40,8 +33,8 @@ end it 'forms meta data' do - VCR.use_cassette('appointments/get_facilities', match_requests_on: %i[method uri]) do - VCR.use_cassette('facilities/ppms/community_clinics_near_facility', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/get_facilities', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/facilities/ppms/community_clinics_near_facility', match_requests_on: %i[method uri]) do params = { serviceType: 'podiatry', facilityId: '442' } get('/mobile/v0/community-care-providers', headers: iam_headers, params:) @@ -72,7 +65,7 @@ context 'when no providers are within the search parameters' do it 'returns an empty list' do - VCR.use_cassette('facilities/ppms/community_clinics_empty_search', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/facilities/ppms/community_clinics_empty_search', match_requests_on: %i[method uri]) do params = { serviceType: 'podiatry' } get('/mobile/v0/community-care-providers', headers: iam_headers, params:) expect(response).to have_http_status(:success) @@ -83,7 +76,7 @@ context 'when no facility id is provided' do it 'returns a list of providers based on the user\'s home address' do - VCR.use_cassette('facilities/ppms/community_clinics_near_user', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/facilities/ppms/community_clinics_near_user', match_requests_on: %i[method uri]) do params = { serviceType: 'podiatry' } get('/mobile/v0/community-care-providers', headers: iam_headers, params:) expect(response).to have_http_status(:success) @@ -93,7 +86,7 @@ context 'when the user has no home address' do it 'returns 422 with error message' do - VCR.use_cassette('facilities/ppms/community_clinics_near_user', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/facilities/ppms/community_clinics_near_user', match_requests_on: %i[method uri]) do address = user.vet360_contact_info.residential_address address.latitude = nil address.longitude = nil @@ -109,8 +102,9 @@ context 'when a facility id is provided' do it 'requests community care clinics near the facility' do - VCR.use_cassette('appointments/get_facilities', match_requests_on: %i[method uri]) do - VCR.use_cassette('facilities/ppms/community_clinics_near_facility', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/get_facilities', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/facilities/ppms/community_clinics_near_facility', + match_requests_on: %i[method uri]) do params = { facilityId: '442', serviceType: 'podiatry' } get('/mobile/v0/community-care-providers', headers: iam_headers, params:) expect(response).to have_http_status(:success) @@ -120,8 +114,9 @@ context 'when facility id is not found' do it 'returns not found with a helpful error message' do - VCR.use_cassette('lighthouse_health/get_facilities_empty', match_requests_on: %i[method uri]) do - VCR.use_cassette('facilities/ppms/community_clinics_near_facility', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_facilities_empty', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/facilities/ppms/community_clinics_near_facility', + match_requests_on: %i[method uri]) do params = { facilityId: '442', serviceType: 'podiatry' } get('/mobile/v0/community-care-providers', headers: iam_headers, params:) diff --git a/modules/mobile/spec/request/decision_letters_request_spec.rb b/modules/mobile/spec/request/decision_letters_request_spec.rb index ff73bf4e40f..bd700b65961 100644 --- a/modules/mobile/spec/request/decision_letters_request_spec.rb +++ b/modules/mobile/spec/request/decision_letters_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' require Rails.root.join('modules', 'claims_api', 'spec', 'support', 'fake_vbms.rb') @@ -64,8 +64,8 @@ it 'retrieves a single letter based on document id' do doc_id = '{27832B64-2D88-4DEE-9F6F-DF80E4CAAA87}' - VCR.use_cassette('bgs/uploaded_document_service/uploaded_document_data') do - VCR.use_cassette('bgs/people_service/person_data') do + VCR.use_cassette('mobile/bgs/uploaded_document_service/uploaded_document_data') do + VCR.use_cassette('mobile/bgs/people_service/person_data') do get "/mobile/v0/claims/decision-letters/#{CGI.escape(doc_id)}/download", headers: iam_headers expect(response).to have_http_status(:ok) end @@ -75,8 +75,8 @@ it 'raises a RecordNotFound exception when it cannot find a document' do doc_id = '{37832B64-2D88-4DEE-9F6F-DF80E4CAAA87}' - VCR.use_cassette('bgs/uploaded_document_service/uploaded_document_data') do - VCR.use_cassette('bgs/people_service/person_data') do + VCR.use_cassette('mobile/bgs/uploaded_document_service/uploaded_document_data') do + VCR.use_cassette('mobile/bgs/people_service/person_data') do get "/mobile/v0/decision-letters/#{CGI.escape(doc_id)}", headers: iam_headers expect(response).to have_http_status(:not_found) end diff --git a/modules/mobile/spec/request/disability_rating_request_spec.rb b/modules/mobile/spec/request/disability_rating_request_spec.rb index 2b9b728312b..73ba443de6f 100644 --- a/modules/mobile/spec/request/disability_rating_request_spec.rb +++ b/modules/mobile/spec/request/disability_rating_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'Mobile Disability Rating API endpoint', type: :request do @@ -11,13 +11,6 @@ iam_sign_in end - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - let(:expected_response) do { 'data' => { @@ -47,8 +40,8 @@ describe 'Get /v0/disability-rating' do context 'with a valid 200 evss response' do it 'matches the rated disabilities schema' do - VCR.use_cassette('profile/rating_info') do - VCR.use_cassette('profile/rated_disabilities') do + VCR.use_cassette('mobile/profile/rating_info') do + VCR.use_cassette('mobile/profile/rated_disabilities') do get '/mobile/v0/disability-rating', params: nil, headers: iam_headers expect(response).to have_http_status(:ok) expect(JSON.parse(response.body)).to eq(expected_response) @@ -60,8 +53,8 @@ context 'with a valid response that includes service connected and not connected' do before do - VCR.use_cassette('profile/rating_info') do - VCR.use_cassette('profile/rated_disabilities_mixed_service_connected') do + VCR.use_cassette('mobile/profile/rating_info') do + VCR.use_cassette('mobile/profile/rated_disabilities_mixed_service_connected') do get '/mobile/v0/disability-rating', params: nil, headers: iam_headers end end @@ -94,8 +87,8 @@ context 'with a 500 response for individual ratings' do it 'returns a bad gateway response' do - VCR.use_cassette('profile/rating_info') do - VCR.use_cassette('profile/rated_disabilities_500') do + VCR.use_cassette('mobile/profile/rating_info') do + VCR.use_cassette('mobile/profile/rated_disabilities_500') do get '/mobile/v0/disability-rating', params: nil, headers: iam_headers expect(response).to have_http_status(:bad_gateway) expect(response.body).to match_json_schema('evss_errors') @@ -106,8 +99,8 @@ context 'with a 500 response for combine rating' do it 'returns a bad gateway response' do - VCR.use_cassette('profile/rating_info_500') do - VCR.use_cassette('profile/rated_disabilities') do + VCR.use_cassette('mobile/profile/rating_info_500') do + VCR.use_cassette('mobile/profile/rated_disabilities') do get '/mobile/v0/disability-rating', params: nil, headers: iam_headers expect(response).to have_http_status(:bad_gateway) expect(response.body).to match_json_schema('evss_errors') @@ -118,8 +111,8 @@ context 'with a 500 response for both' do it 'returns a bad gateway response' do - VCR.use_cassette('profile/rating_info_500') do - VCR.use_cassette('profile/rated_disabilities_500') do + VCR.use_cassette('mobile/profile/rating_info_500') do + VCR.use_cassette('mobile/profile/rated_disabilities_500') do get '/mobile/v0/disability-rating', params: nil, headers: iam_headers expect(response).to have_http_status(:bad_gateway) expect(response.body).to match_json_schema('evss_errors') @@ -130,8 +123,8 @@ context 'with a 400 response for individual ratings' do it 'returns a not found response' do - VCR.use_cassette('profile/rating_info') do - VCR.use_cassette('profile/rated_disabilities_400') do + VCR.use_cassette('mobile/profile/rating_info') do + VCR.use_cassette('mobile/profile/rated_disabilities_400') do get '/mobile/v0/disability-rating', params: nil, headers: iam_headers expect(response).to have_http_status(:not_found) expect(response.body).to match_json_schema('evss_errors') @@ -142,8 +135,8 @@ context 'with a 400 response for combine rating' do it 'returns a not found response' do - VCR.use_cassette('profile/rating_info_400') do - VCR.use_cassette('profile/rated_disabilities') do + VCR.use_cassette('mobile/profile/rating_info_400') do + VCR.use_cassette('mobile/profile/rated_disabilities') do get '/mobile/v0/disability-rating', params: nil, headers: iam_headers expect(response).to have_http_status(:not_found) expect(response.body).to match_json_schema('evss_errors') @@ -154,8 +147,8 @@ context 'with a 400 response for both' do it 'returns a not found response' do - VCR.use_cassette('profile/rating_info_400') do - VCR.use_cassette('profile/rated_disabilities_400') do + VCR.use_cassette('mobile/profile/rating_info_400') do + VCR.use_cassette('mobile/profile/rated_disabilities_400') do get '/mobile/v0/disability-rating', params: nil, headers: iam_headers expect(response).to have_http_status(:not_found) expect(response.body).to match_json_schema('evss_errors') @@ -166,8 +159,8 @@ context 'with a 403 response for individual ratings' do it 'returns a forbidden response' do - VCR.use_cassette('profile/rating_info') do - VCR.use_cassette('profile/rated_disabilities_403') do + VCR.use_cassette('mobile/profile/rating_info') do + VCR.use_cassette('mobile/profile/rated_disabilities_403') do get '/mobile/v0/disability-rating', params: nil, headers: iam_headers expect(response).to have_http_status(:forbidden) expect(response.body).to match_json_schema('evss_errors') @@ -178,8 +171,8 @@ context 'with a 403 response for combine rating' do it 'returns a not found response' do - VCR.use_cassette('profile/rating_info_403') do - VCR.use_cassette('profile/rated_disabilities') do + VCR.use_cassette('mobile/profile/rating_info_403') do + VCR.use_cassette('mobile/profile/rated_disabilities') do get '/mobile/v0/disability-rating', params: nil, headers: iam_headers expect(response).to have_http_status(:forbidden) expect(response.body).to match_json_schema('evss_errors') @@ -190,8 +183,8 @@ context 'with a 403 response for both' do it 'returns a not found response' do - VCR.use_cassette('profile/rating_info_403') do - VCR.use_cassette('profile/rated_disabilities_403') do + VCR.use_cassette('mobile/profile/rating_info_403') do + VCR.use_cassette('mobile/profile/rated_disabilities_403') do get '/mobile/v0/disability-rating', params: nil, headers: iam_headers expect(response).to have_http_status(:forbidden) expect(response.body).to match_json_schema('evss_errors') diff --git a/modules/mobile/spec/request/discovery_request_spec.rb b/modules/mobile/spec/request/discovery_request_spec.rb index 2829ab66230..8d491b1c353 100644 --- a/modules/mobile/spec/request/discovery_request_spec.rb +++ b/modules/mobile/spec/request/discovery_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'discovery', type: :request do diff --git a/modules/mobile/spec/request/emails_request_spec.rb b/modules/mobile/spec/request/emails_request_spec.rb index 7fdf3be57ae..7e289135531 100644 --- a/modules/mobile/spec/request/emails_request_spec.rb +++ b/modules/mobile/spec/request/emails_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'email', type: :request do @@ -9,22 +9,15 @@ before { iam_sign_in(user) } - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - let(:user) { FactoryBot.build(:iam_user) } let(:json_body_headers) { { 'Content-Type' => 'application/json', 'Accept' => 'application/json' } } describe 'POST /mobile/v0/user/emails' do context 'with a valid email that takes two tries to complete' do before do - VCR.use_cassette('profile/get_email_status_complete') do - VCR.use_cassette('profile/get_email_status_incomplete') do - VCR.use_cassette('profile/post_email_initial') do + VCR.use_cassette('mobile/profile/get_email_status_complete') do + VCR.use_cassette('mobile/profile/get_email_status_incomplete') do + VCR.use_cassette('mobile/profile/post_email_initial') do post '/mobile/v0/user/emails', params: { id: 42, email_address: 'person42@example.com' }.to_json, headers: iam_headers(json_body_headers) @@ -80,9 +73,9 @@ describe 'PUT /mobile/v0/user/emails' do context 'with a valid email that takes two tries to complete' do before do - VCR.use_cassette('profile/get_email_status_complete') do - VCR.use_cassette('profile/get_email_status_incomplete') do - VCR.use_cassette('profile/put_email_initial') do + VCR.use_cassette('mobile/profile/get_email_status_complete') do + VCR.use_cassette('mobile/profile/get_email_status_incomplete') do + VCR.use_cassette('mobile/profile/put_email_initial') do put '/mobile/v0/user/emails', params: { id: 42, email_address: 'person42@example.com' }.to_json, headers: iam_headers(json_body_headers) @@ -147,9 +140,9 @@ allow_any_instance_of(User).to receive(:icn).and_return('64762895576664260') email.id = id_in_cassette - VCR.use_cassette('profile/get_email_status_complete') do - VCR.use_cassette('profile/get_email_status_incomplete') do - VCR.use_cassette('profile/delete_email_initial') do + VCR.use_cassette('mobile/profile/get_email_status_complete') do + VCR.use_cassette('mobile/profile/get_email_status_incomplete') do + VCR.use_cassette('mobile/profile/delete_email_initial') do delete '/mobile/v0/user/emails', params: { id: 42, email_address: 'person42@example.com' }.to_json, headers: iam_headers(json_body_headers) diff --git a/modules/mobile/spec/request/facilities_info_request_spec.rb b/modules/mobile/spec/request/facilities_info_request_spec.rb index b1ede4ba431..b2ace493d9e 100644 --- a/modules/mobile/spec/request/facilities_info_request_spec.rb +++ b/modules/mobile/spec/request/facilities_info_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'facilities info', type: :request do @@ -26,13 +26,6 @@ appointments = va_appointments.sort_by(&:start_date_utc) - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - describe 'GET /mobile/v0/facilities-info' do context 'when there are appointments' do before do @@ -40,7 +33,7 @@ end it 'returns facility details sorted by closest to home' do - VCR.use_cassette('appointments/get_multiple_mfs_facilities_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/get_multiple_mfs_facilities_200', match_requests_on: %i[method uri]) do get('/mobile/v0/facilities-info/home', headers: iam_headers, params:) facilities = response.parsed_body.dig('data', 'attributes', 'facilities') expect(response).to have_http_status(:ok) @@ -51,7 +44,7 @@ end it 'returns facility details sorted by closest to current location' do - VCR.use_cassette('appointments/get_multiple_mfs_facilities_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/get_multiple_mfs_facilities_200', match_requests_on: %i[method uri]) do get('/mobile/v0/facilities-info/current', headers: iam_headers, params:) facilities = response.parsed_body.dig('data', 'attributes', 'facilities') expect(response).to have_http_status(:ok) @@ -62,7 +55,7 @@ end it 'returns facility details sorted alphabetically' do - VCR.use_cassette('appointments/get_multiple_mfs_facilities_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/get_multiple_mfs_facilities_200', match_requests_on: %i[method uri]) do get('/mobile/v0/facilities-info/alphabetical', headers: iam_headers, params:) facilities = response.parsed_body.dig('data', 'attributes', 'facilities') expect(response).to have_http_status(:ok) @@ -73,7 +66,7 @@ end it 'returns facility details sorted by most recent appointment' do - VCR.use_cassette('appointments/get_multiple_mfs_facilities_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/get_multiple_mfs_facilities_200', match_requests_on: %i[method uri]) do get('/mobile/v0/facilities-info/appointments', headers: iam_headers, params:) facilities = response.parsed_body.dig('data', 'attributes', 'facilities') expect(response).to have_http_status(:ok) @@ -85,7 +78,7 @@ context 'when current location params are missing and sort by current is selected' do it 'returns an error' do - VCR.use_cassette('appointments/get_multiple_mfs_facilities_200', + VCR.use_cassette('mobile/appointments/get_multiple_mfs_facilities_200', match_requests_on: %i[method uri]) do get '/mobile/v0/facilities-info/current', headers: iam_headers, params: nil expect(response).to have_http_status(:bad_request) @@ -100,7 +93,7 @@ 'code' => '103', 'status' => '400' }] - VCR.use_cassette('appointments/legacy_get_facilities_for_facilities_info', + VCR.use_cassette('mobile/appointments/legacy_get_facilities_for_facilities_info', match_requests_on: %i[method uri]) do get('/mobile/v0/facilities-info/test', headers: iam_headers, params:) expect(response.parsed_body['errors']).to eq(expected_error_message) @@ -114,7 +107,7 @@ end it 'returns facility details sorted alphabetically' do - VCR.use_cassette('appointments/get_multiple_facilities_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/get_multiple_facilities_200', match_requests_on: %i[method uri]) do get('/mobile/v0/facilities-info/appointments', headers: iam_headers, params:) facilities = response.parsed_body.dig('data', 'attributes', 'facilities') expect(response).to have_http_status(:ok) @@ -132,7 +125,7 @@ end it 'logs the cache is nil and still returns alphabetized facilities' do - VCR.use_cassette('appointments/get_multiple_facilities_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/get_multiple_facilities_200', match_requests_on: %i[method uri]) do get('/mobile/v0/facilities-info/appointments', headers: iam_headers, params:) expect(Rails.logger).to have_received(:info).with('mobile facilities info appointments cache nil', user_uuid: '3097e489-ad75-5746-ab1a-e0aabc1b426a') @@ -153,7 +146,7 @@ end it 'remaining facilities are sorted alphabetically' do - VCR.use_cassette('appointments/get_multiple_facilities_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/get_multiple_facilities_200', match_requests_on: %i[method uri]) do get('/mobile/v0/facilities-info/appointments', headers: iam_headers, params:) facilities = response.parsed_body.dig('data', 'attributes', 'facilities') expect(response).to have_http_status(:ok) diff --git a/modules/mobile/spec/request/facility_eligibility_request_spec.rb b/modules/mobile/spec/request/facility_eligibility_request_spec.rb index f012bc41342..68b82edf612 100644 --- a/modules/mobile/spec/request/facility_eligibility_request_spec.rb +++ b/modules/mobile/spec/request/facility_eligibility_request_spec.rb @@ -1,19 +1,12 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'Facility Eligibility', type: :request do include JsonSchemaMatchers - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - before do allow_any_instance_of(IAMUser).to receive(:icn).and_return('9000682') iam_sign_in(build(:iam_user)) @@ -29,9 +22,9 @@ end before do - VCR.use_cassette('facility_eligibility/get_patient_appointment_metadata_facility_102', + VCR.use_cassette('mobile/facility_eligibility/get_patient_appointment_metadata_facility_102', match_requests_on: %i[method uri]) do - VCR.use_cassette('facility_eligibility/get_patient_appointment_metadata_facility_103', + VCR.use_cassette('mobile/facility_eligibility/get_patient_appointment_metadata_facility_103', match_requests_on: %i[method uri]) do get '/mobile/v0/appointments/facility/eligibility', params:, headers: iam_headers end @@ -61,11 +54,11 @@ end before do - VCR.use_cassette('facility_eligibility/get_patient_appointment_metadata_facility_100', + VCR.use_cassette('mobile/facility_eligibility/get_patient_appointment_metadata_facility_100', match_requests_on: %i[method uri]) do - VCR.use_cassette('facility_eligibility/get_patient_appointment_metadata_facility_101', + VCR.use_cassette('mobile/facility_eligibility/get_patient_appointment_metadata_facility_101', match_requests_on: %i[method uri]) do - VCR.use_cassette('facility_eligibility/get_patient_appointment_metadata_facility_102', + VCR.use_cassette('mobile/facility_eligibility/get_patient_appointment_metadata_facility_102', match_requests_on: %i[method uri]) do get '/mobile/v0/appointments/facility/eligibility', params:, headers: iam_headers end @@ -116,7 +109,7 @@ end before do - VCR.use_cassette('facility_eligibility/get_patient_appointment_metadata_bad_facility', + VCR.use_cassette('mobile/facility_eligibility/get_patient_appointment_metadata_bad_facility', match_requests_on: %i[method uri]) do get '/mobile/v0/appointments/facility/eligibility', params:, headers: iam_headers end diff --git a/modules/mobile/spec/request/folders_request_spec.rb b/modules/mobile/spec/request/folders_request_spec.rb index c64833280df..131d40b7f0f 100644 --- a/modules/mobile/spec/request/folders_request_spec.rb +++ b/modules/mobile/spec/request/folders_request_spec.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' -require_relative '../support/mobile_sm_client_helper' +require_relative '../support/helpers/iam_session_helper' +require_relative '../support/helpers/mobile_sm_client_helper' RSpec.describe 'Mobile Folders Integration', type: :request do include Mobile::MessagingClientHelper diff --git a/modules/mobile/spec/request/gender_identity_request_spec.rb b/modules/mobile/spec/request/gender_identity_request_spec.rb index 9672adc039c..46eeeecd555 100644 --- a/modules/mobile/spec/request/gender_identity_request_spec.rb +++ b/modules/mobile/spec/request/gender_identity_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require 'va_profile/demographics/service' RSpec.describe 'gender identity', type: :request do diff --git a/modules/mobile/spec/request/immunizations_request_spec.rb b/modules/mobile/spec/request/immunizations_request_spec.rb index a011e8fbae2..4a1254ee1b4 100644 --- a/modules/mobile/spec/request/immunizations_request_spec.rb +++ b/modules/mobile/spec/request/immunizations_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'immunizations', type: :request do @@ -9,13 +9,6 @@ let(:rsa_key) { OpenSSL::PKey::RSA.generate(2048) } - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - before do allow(File).to receive(:read).and_return(rsa_key.to_s) allow_any_instance_of(IAMUser).to receive(:icn).and_return('9000682') @@ -28,7 +21,7 @@ describe 'GET /mobile/v0/health/immunizations' do context 'when the expected fields have data' do before do - VCR.use_cassette('lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do get '/mobile/v0/health/immunizations', headers: iam_headers, params: nil end end @@ -452,7 +445,7 @@ context 'when entry is missing' do before do - VCR.use_cassette('lighthouse_health/get_immunizations_no_entry', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations_no_entry', match_requests_on: %i[method uri]) do get '/mobile/v0/health/immunizations', headers: iam_headers, params: nil end end @@ -465,7 +458,7 @@ context 'when the note is null or an empty array' do before do - VCR.use_cassette('lighthouse_health/get_immunizations_blank_note', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations_blank_note', match_requests_on: %i[method uri]) do get '/mobile/v0/health/immunizations', headers: iam_headers, params: nil end end @@ -491,7 +484,7 @@ describe 'vaccine group name and manufacturer population' do let(:immunizations_request) do - VCR.use_cassette('lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do get '/mobile/v0/health/immunizations', headers: iam_headers, params: nil end end @@ -587,7 +580,8 @@ context 'when cvx_code is missing' do let(:immunizations_request_missing_cvx) do - VCR.use_cassette('lighthouse_health/get_immunizations_cvx_code_missing', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations_cvx_code_missing', + match_requests_on: %i[method uri]) do get '/mobile/v0/health/immunizations', headers: iam_headers, params: nil end end @@ -613,7 +607,8 @@ context 'when date is missing' do let(:immunizations_request_missing_date) do - VCR.use_cassette('lighthouse_health/get_immunizations_date_missing', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations_date_missing', + match_requests_on: %i[method uri]) do get '/mobile/v0/health/immunizations', headers: iam_headers, params: nil end end @@ -637,7 +632,8 @@ context 'when group name is missing' do it 'returns a 200' do - VCR.use_cassette('lighthouse_health/get_immunizations_blank_group_name', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations_blank_group_name', + match_requests_on: %i[method uri]) do get '/mobile/v0/health/immunizations', headers: iam_headers, params: nil expect(response).to have_http_status(:ok) end @@ -648,7 +644,7 @@ describe 'order' do context 'date is available' do it 'is sorted by descending date, then alphabetically by group name within a date' do - VCR.use_cassette('lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do get '/mobile/v0/health/immunizations', headers: iam_headers, params: nil end dates = response.parsed_body['data'].map { |imm| imm['attributes']['date'] } @@ -664,7 +660,8 @@ context 'date is missing' do it 'is sorted by descending date, then alphabetically by group name within a date, with nil dates last' do - VCR.use_cassette('lighthouse_health/get_immunizations_date_missing', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations_date_missing', + match_requests_on: %i[method uri]) do get '/mobile/v0/health/immunizations', headers: iam_headers, params: nil end dates = response.parsed_body['data'].map { |imm| imm['attributes']['date'] } diff --git a/modules/mobile/spec/request/individual_appeal_request_spec.rb b/modules/mobile/spec/request/individual_appeal_request_spec.rb index 21bee392325..f358d824b09 100644 --- a/modules/mobile/spec/request/individual_appeal_request_spec.rb +++ b/modules/mobile/spec/request/individual_appeal_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'individual appeal', type: :request do diff --git a/modules/mobile/spec/request/individual_claim_request_spec.rb b/modules/mobile/spec/request/individual_claim_request_spec.rb index a9f922f6556..a55f0b1c956 100644 --- a/modules/mobile/spec/request/individual_claim_request_spec.rb +++ b/modules/mobile/spec/request/individual_claim_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'individual claim', type: :request do diff --git a/modules/mobile/spec/request/individual_lighthouse_claim_request_spec.rb b/modules/mobile/spec/request/individual_lighthouse_claim_request_spec.rb index a652df789ac..702cb13dc05 100644 --- a/modules/mobile/spec/request/individual_lighthouse_claim_request_spec.rb +++ b/modules/mobile/spec/request/individual_lighthouse_claim_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' require 'lighthouse/benefits_claims/configuration' require 'lighthouse/benefits_claims/service' @@ -9,13 +9,6 @@ RSpec.describe 'lighthouse individual claim', type: :request do include JsonSchemaMatchers - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - describe 'GET /v0/claim/:id with lighthouse upstream service' do before do token = 'abcdefghijklmnop' @@ -30,7 +23,7 @@ context 'when the claim is found' do it 'matches our schema is successfully returned with the 200 status', run_at: 'Wed, 13 Dec 2017 03:28:23 GMT' do - VCR.use_cassette('lighthouse_claims/show/200_response') do + VCR.use_cassette('mobile/lighthouse_claims/show/200_response') do get '/mobile/v0/claim/600117255', headers: iam_headers expect(response).to have_http_status(:ok) expect(response.body).to match_json_schema('individual_claim', strict: true) @@ -41,7 +34,7 @@ context 'with a non-existent claim' do it 'returns a 404 with an error', run_at: 'Wed, 13 Dec 2017 03:28:23 GMT' do - VCR.use_cassette('lighthouse_claims/show/404_response') do + VCR.use_cassette('mobile/lighthouse_claims/show/404_response') do get '/mobile/v0/claim/60038334', headers: iam_headers expect(response).to have_http_status(:not_found) diff --git a/modules/mobile/spec/request/legacy_letters_request_spec.rb b/modules/mobile/spec/request/legacy_letters_request_spec.rb index 4c0cb3dea5d..422d0785f65 100644 --- a/modules/mobile/spec/request/legacy_letters_request_spec.rb +++ b/modules/mobile/spec/request/legacy_letters_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'letters', type: :request do diff --git a/modules/mobile/spec/request/letters_request_spec.rb b/modules/mobile/spec/request/letters_request_spec.rb index 2c49d20a95d..a00fd903cf0 100644 --- a/modules/mobile/spec/request/letters_request_spec.rb +++ b/modules/mobile/spec/request/letters_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' require 'lighthouse/letters_generator/configuration' diff --git a/modules/mobile/spec/request/locations_request_spec.rb b/modules/mobile/spec/request/locations_request_spec.rb index 68431cb9e43..f310668f8d7 100644 --- a/modules/mobile/spec/request/locations_request_spec.rb +++ b/modules/mobile/spec/request/locations_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'locations', type: :request do @@ -9,13 +9,6 @@ let(:rsa_key) { OpenSSL::PKey::RSA.generate(2048) } - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - before do allow(File).to receive(:read).and_return(rsa_key.to_s) allow_any_instance_of(IAMUser).to receive(:icn).and_return('9000682') @@ -28,8 +21,8 @@ describe 'GET /mobile/v0/health/locations/:id' do context 'When a valid ID is provided' do before do - VCR.use_cassette('lighthouse_health/get_facility', match_requests_on: %i[method uri]) do - VCR.use_cassette('lighthouse_health/get_lh_location', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_facility', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_lh_location', match_requests_on: %i[method uri]) do get '/mobile/v0/health/locations/I2-3JYDMXC6RXTU4H25KRVXATSEJQ000000', headers: iam_headers end end @@ -59,8 +52,8 @@ context 'When the facilities endpoint fails to find the location' do before do - VCR.use_cassette('lighthouse_health/get_facilities_empty', match_requests_on: %i[method uri]) do - VCR.use_cassette('lighthouse_health/get_lh_location', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_facilities_empty', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_lh_location', match_requests_on: %i[method uri]) do get '/mobile/v0/health/locations/I2-3JYDMXC6RXTU4H25KRVXATSEJQ000000', headers: iam_headers end end @@ -73,7 +66,7 @@ context 'When lh location returns 404' do before do - VCR.use_cassette('lighthouse_health/get_lh_location_404', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_lh_location_404', match_requests_on: %i[method uri]) do get '/mobile/v0/health/locations/FAKE-ID', headers: iam_headers end end @@ -85,7 +78,7 @@ context 'When lh location has no identifier' do before do - VCR.use_cassette('lighthouse_health/get_lh_location_no_identifier', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_lh_location_no_identifier', match_requests_on: %i[method uri]) do get '/mobile/v0/health/locations/I2-3JYDMXC6RXTU4H25KRVXATSEJQ000000', headers: iam_headers end end diff --git a/modules/mobile/spec/request/maintenance_windows_request_spec.rb b/modules/mobile/spec/request/maintenance_windows_request_spec.rb index 5d247b927a8..9191ee2ef6a 100644 --- a/modules/mobile/spec/request/maintenance_windows_request_spec.rb +++ b/modules/mobile/spec/request/maintenance_windows_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'maintenance windows', type: :request do diff --git a/modules/mobile/spec/request/message_drafts_request_spec.rb b/modules/mobile/spec/request/message_drafts_request_spec.rb index e5e775bff0d..4e98cfdf153 100644 --- a/modules/mobile/spec/request/message_drafts_request_spec.rb +++ b/modules/mobile/spec/request/message_drafts_request_spec.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' -require_relative '../support/mobile_sm_client_helper' +require_relative '../support/helpers/iam_session_helper' +require_relative '../support/helpers/mobile_sm_client_helper' RSpec.describe 'Mobile Message Drafts Integration', type: :request do include Mobile::MessagingClientHelper diff --git a/modules/mobile/spec/request/messages_request_spec.rb b/modules/mobile/spec/request/messages_request_spec.rb index facdd2f2d8e..44ab4c7f1d3 100644 --- a/modules/mobile/spec/request/messages_request_spec.rb +++ b/modules/mobile/spec/request/messages_request_spec.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' -require_relative '../support/mobile_sm_client_helper' +require_relative '../support/helpers/iam_session_helper' +require_relative '../support/helpers/mobile_sm_client_helper' RSpec.describe 'Mobile Messages Integration', type: :request do include Mobile::MessagingClientHelper diff --git a/modules/mobile/spec/request/military_information_request_spec.rb b/modules/mobile/spec/request/military_information_request_spec.rb index 9b1ff491c3d..0ddb139e9ca 100644 --- a/modules/mobile/spec/request/military_information_request_spec.rb +++ b/modules/mobile/spec/request/military_information_request_spec.rb @@ -1,19 +1,12 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'military_information', type: :request do include JsonSchemaMatchers - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - describe 'GET /mobile/v0/military-service-history' do context 'with a user who has a cached iam session' do before { iam_sign_in } @@ -123,7 +116,7 @@ context 'with multiple military service episodes' do it 'matches the mobile service history schema' do - VCR.use_cassette('va_profile/post_read_service_histories_200') do + VCR.use_cassette('mobile/va_profile/post_read_service_histories_200') do get '/mobile/v0/military-service-history', headers: iam_headers expect(response).to have_http_status(:ok) expect(JSON.parse(response.body)).to eq(expected_body_multi) @@ -134,7 +127,7 @@ context 'with one military service episode' do it 'matches the mobile service history schema' do - VCR.use_cassette('va_profile/post_read_service_history_200') do + VCR.use_cassette('mobile/va_profile/post_read_service_history_200') do get '/mobile/v0/military-service-history', headers: iam_headers expect(response).to have_http_status(:ok) expect(JSON.parse(response.body)).to eq(expected_body_single) @@ -145,7 +138,7 @@ context 'military service episode with no end date' do it 'matches the mobile service history schema' do - VCR.use_cassette('va_profile/post_read_service_histories_200_no_end_date') do + VCR.use_cassette('mobile/va_profile/post_read_service_histories_200_no_end_date') do get '/mobile/v0/military-service-history', headers: iam_headers expect(response).to have_http_status(:ok) expect(JSON.parse(response.body)).to eq(expected_body_no_end_date) @@ -156,7 +149,7 @@ context 'with an empty military service episode' do it 'matches the mobile service history schema' do - VCR.use_cassette('va_profile/post_read_service_history_200_empty') do + VCR.use_cassette('mobile/va_profile/post_read_service_history_200_empty') do get '/mobile/v0/military-service-history', headers: iam_headers expect(response).to have_http_status(:ok) expect(JSON.parse(response.body)).to eq(expected_body_empty) diff --git a/modules/mobile/spec/request/payment_history_request_spec.rb b/modules/mobile/spec/request/payment_history_request_spec.rb index a5cfe7bb1c6..5cbd694e21a 100644 --- a/modules/mobile/spec/request/payment_history_request_spec.rb +++ b/modules/mobile/spec/request/payment_history_request_spec.rb @@ -1,25 +1,19 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'payment_history', type: :request do include JsonSchemaMatchers - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - before { iam_sign_in(FactoryBot.build(:iam_user, :no_email)) } describe 'GET /mobile/v0/payment-history' do context 'with successful response with the default (no) parameters' do before do - VCR.use_cassette('payment_history/retrieve_payment_summary_with_bdn', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/payment_history/retrieve_payment_summary_with_bdn', + match_requests_on: %i[method uri]) do get '/mobile/v0/payment-history', headers: iam_headers, params: nil end end @@ -80,7 +74,8 @@ end before do - VCR.use_cassette('payment_history/retrieve_payment_summary_with_bdn', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/payment_history/retrieve_payment_summary_with_bdn', + match_requests_on: %i[method uri]) do get '/mobile/v0/payment-history', headers: iam_headers, params: end end @@ -96,7 +91,8 @@ let(:params) { { page: } } before do - VCR.use_cassette('payment_history/retrieve_payment_summary_with_bdn', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/payment_history/retrieve_payment_summary_with_bdn', + match_requests_on: %i[method uri]) do get '/mobile/v0/payment-history', headers: iam_headers, params: end end @@ -111,7 +107,8 @@ let(:params) { { page: { number: 'one', size: 'ten' } } } before do - VCR.use_cassette('payment_history/retrieve_payment_summary_with_bdn', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/payment_history/retrieve_payment_summary_with_bdn', + match_requests_on: %i[method uri]) do get '/mobile/v0/payment-history', headers: iam_headers, params: end end @@ -150,7 +147,8 @@ end before do - VCR.use_cassette('payment_history/retrieve_payment_summary_with_bdn', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/payment_history/retrieve_payment_summary_with_bdn', + match_requests_on: %i[method uri]) do get '/mobile/v0/payment-history', headers: iam_headers, params: end end @@ -186,7 +184,8 @@ end before do - VCR.use_cassette('payment_history/retrieve_payment_summary_with_bdn', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/payment_history/retrieve_payment_summary_with_bdn', + match_requests_on: %i[method uri]) do get '/mobile/v0/payment-history', headers: iam_headers, params: end end @@ -267,7 +266,7 @@ context 'with an invalid date in payment history' do before do allow(Rails.logger).to receive(:warn) - VCR.use_cassette('payment_history/retrieve_payment_summary_with_bdn_blank_date', + VCR.use_cassette('mobile/payment_history/retrieve_payment_summary_with_bdn_blank_date', match_requests_on: %i[method uri]) do get '/mobile/v0/payment-history', headers: iam_headers end @@ -281,7 +280,7 @@ context 'with an only scheduled payments ' do before do allow(Rails.logger).to receive(:warn) - VCR.use_cassette('payment_history/retrieve_payment_summary_with_bdn_only_blank_dates', + VCR.use_cassette('mobile/payment_history/retrieve_payment_summary_with_bdn_only_blank_dates', match_requests_on: %i[method uri]) do get '/mobile/v0/payment-history', headers: iam_headers end diff --git a/modules/mobile/spec/request/payment_information_request_spec.rb b/modules/mobile/spec/request/payment_information_request_spec.rb index aef199b15bc..8af1e6e8298 100644 --- a/modules/mobile/spec/request/payment_information_request_spec.rb +++ b/modules/mobile/spec/request/payment_information_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'payment_information', type: :request do @@ -74,13 +74,6 @@ end context 'with a user who is not authorized to update payment information' do - before do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - let(:get_payment_info_body) do { 'data' => { @@ -111,7 +104,7 @@ end it 'has canUpdatePayment as false' do - VCR.use_cassette('/payment_information/payment_information_unauthorized_to_update') do + VCR.use_cassette('mobile/payment_information/payment_information_unauthorized_to_update') do get '/mobile/v0/payment-information/benefits', headers: iam_headers expect(response).to have_http_status(:ok) expect(JSON.parse(response.body)).to eq(get_payment_info_body) diff --git a/modules/mobile/spec/request/phones_request_spec.rb b/modules/mobile/spec/request/phones_request_spec.rb index a27cdc29bb4..fcf9e86d9c0 100644 --- a/modules/mobile/spec/request/phones_request_spec.rb +++ b/modules/mobile/spec/request/phones_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'phones', type: :request do @@ -9,13 +9,6 @@ before { iam_sign_in(user) } - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - let(:user) { FactoryBot.build(:iam_user) } let(:json_body_headers) { { 'Content-Type' => 'application/json', 'Accept' => 'application/json' } } let(:telephone) { build(:telephone, vet360_id: user.vet360_id) } @@ -25,9 +18,9 @@ before do telephone.id = 42 - VCR.use_cassette('profile/get_phone_status_complete') do - VCR.use_cassette('profile/get_phone_status_incomplete') do - VCR.use_cassette('profile/post_phone_initial') do + VCR.use_cassette('mobile/profile/get_phone_status_complete') do + VCR.use_cassette('mobile/profile/get_phone_status_incomplete') do + VCR.use_cassette('mobile/profile/post_phone_initial') do post('/mobile/v0/user/phones', params: telephone.to_json, headers: iam_headers(json_body_headers)) end end @@ -84,9 +77,9 @@ before do telephone.id = 42 - VCR.use_cassette('profile/get_phone_status_complete') do - VCR.use_cassette('profile/get_phone_status_incomplete') do - VCR.use_cassette('profile/put_phone_initial') do + VCR.use_cassette('mobile/profile/get_phone_status_complete') do + VCR.use_cassette('mobile/profile/get_phone_status_incomplete') do + VCR.use_cassette('mobile/profile/put_phone_initial') do put('/mobile/v0/user/phones', params: telephone.to_json, headers: iam_headers(json_body_headers)) end end @@ -143,9 +136,9 @@ before do telephone.id = 42 - VCR.use_cassette('profile/get_phone_status_complete') do - VCR.use_cassette('profile/get_phone_status_incomplete') do - VCR.use_cassette('profile/delete_phone_initial') do + VCR.use_cassette('mobile/profile/get_phone_status_complete') do + VCR.use_cassette('mobile/profile/get_phone_status_incomplete') do + VCR.use_cassette('mobile/profile/delete_phone_initial') do delete '/mobile/v0/user/phones', params: telephone.to_json, headers: iam_headers(json_body_headers) diff --git a/modules/mobile/spec/request/preferred_name_request_spec.rb b/modules/mobile/spec/request/preferred_name_request_spec.rb index c54019085d2..5f1ddaf06e2 100644 --- a/modules/mobile/spec/request/preferred_name_request_spec.rb +++ b/modules/mobile/spec/request/preferred_name_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require 'va_profile/demographics/service' RSpec.describe 'preferred_name', type: :request do @@ -66,7 +66,7 @@ it 'returns 204', :aggregate_failures do preferred_name = VAProfile::Models::PreferredName.new(text: 'Pat') VCR.use_cassette('mobile/va_profile/post_preferred_name_success') do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do put('/mobile/v0/user/preferred_name', params: preferred_name.to_h, headers: iam_headers) expect(response).to have_http_status(:no_content) diff --git a/modules/mobile/spec/request/prescriptions_request_spec.rb b/modules/mobile/spec/request/prescriptions_request_spec.rb index b7624d0d7b6..cdf0136b3b2 100644 --- a/modules/mobile/spec/request/prescriptions_request_spec.rb +++ b/modules/mobile/spec/request/prescriptions_request_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' require 'support/rx_client_helpers' require 'support/shared_examples_for_mhv' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'health/rx/prescriptions', type: :request do @@ -20,13 +20,6 @@ Common::Collection.fetch(::Prescription, cache_key: '123:gethistoryrx', ttl: 3600) { json_data } end - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - before do allow(Settings.mhv.rx).to receive(:collection_caching_enabled).and_return(true) allow_any_instance_of(MHVAccountTypeService).to receive(:mhv_account_type).and_return(mhv_account_type) @@ -38,7 +31,7 @@ describe 'GET /mobile/v0/health/rx/prescriptions/refill', :aggregate_failures do it 'returns all successful refills' do - VCR.use_cassette('rx_refill/prescriptions/refills_prescriptions') do + VCR.use_cassette('mobile/rx_refill/prescriptions/refills_prescriptions') do put '/mobile/v0/health/rx/prescriptions/refill', params: { ids: %w[21530889 21539942] }, headers: iam_headers end expect(response).to have_http_status(:ok) @@ -54,7 +47,7 @@ context 'refill multiple prescription, one of which is non-refillable' do it 'returns error and successful refills' do - VCR.use_cassette('rx_refill/prescriptions/refills_prescriptions_with_error') do + VCR.use_cassette('mobile/rx_refill/prescriptions/refills_prescriptions_with_error') do put '/mobile/v0/health/rx/prescriptions/refill', params: { ids: %w[7417954 6970769 8398465] }, headers: iam_headers end @@ -75,7 +68,7 @@ context 'refill multiple non-refillable prescriptions' do it 'returns error and successful refills' do - VCR.use_cassette('rx_refill/prescriptions/refills_prescriptions_with_multiple_errors') do + VCR.use_cassette('mobile/rx_refill/prescriptions/refills_prescriptions_with_multiple_errors') do put '/mobile/v0/health/rx/prescriptions/refill', params: { ids: %w[7417954 6970769 8398465] }, headers: iam_headers end @@ -117,7 +110,7 @@ context 'refill multiple prescription, one of which does not exist' do it 'returns error and successful refills' do - VCR.use_cassette('rx_refill/prescriptions/refills_prescriptions_not_found') do + VCR.use_cassette('mobile/rx_refill/prescriptions/refills_prescriptions_not_found') do put '/mobile/v0/health/rx/prescriptions/refill', params: { ids: %w[21530889 21539942 123456] }, headers: iam_headers end @@ -140,7 +133,7 @@ it 'flushes prescription cache on refill' do set_cache - VCR.use_cassette('rx_refill/prescriptions/refills_prescriptions') do + VCR.use_cassette('mobile/rx_refill/prescriptions/refills_prescriptions') do put '/mobile/v0/health/rx/prescriptions/refill', params: { ids: %w[21530889 21539942] }, headers: iam_headers end @@ -155,7 +148,7 @@ describe 'GET /mobile/v0/health/rx/prescriptions', :aggregate_failures do context 'with a valid MHV response and no failed facilities' do it 'returns 200' do - VCR.use_cassette('rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do + VCR.use_cassette('mobile/rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do get '/mobile/v0/health/rx/prescriptions', headers: iam_headers end expect(response).to have_http_status(:ok) @@ -165,7 +158,7 @@ context 'with a valid EVSS response and failed facilities' do it 'returns 200 and omits failed facilities' do - VCR.use_cassette('rx_refill/prescriptions/handles_failed_stations') do + VCR.use_cassette('mobile/rx_refill/prescriptions/handles_failed_stations') do get '/mobile/v0/health/rx/prescriptions', headers: iam_headers end expect(response).to have_http_status(:ok) @@ -190,7 +183,7 @@ unauthorized_user = build(:iam_user) iam_sign_in(unauthorized_user) - VCR.use_cassette('rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do + VCR.use_cassette('mobile/rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do get '/mobile/v0/health/rx/prescriptions', headers: iam_headers end expect(response).to have_http_status(:forbidden) @@ -204,7 +197,7 @@ describe 'error cases' do it 'converts 400 errors to 409' do - VCR.use_cassette('rx_refill/prescriptions/gets_optimistic_locking_error') do + VCR.use_cassette('mobile/rx_refill/prescriptions/gets_optimistic_locking_error') do get '/mobile/v0/health/rx/prescriptions', headers: iam_headers end @@ -223,7 +216,7 @@ it 'forms meta data' do params = { page: { number: 2, size: 3 } } - VCR.use_cassette('rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do + VCR.use_cassette('mobile/rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do get '/mobile/v0/health/rx/prescriptions', params:, headers: iam_headers end expect(response).to have_http_status(:ok) @@ -241,7 +234,7 @@ params = { filter: { refill_status: { eq: 'refillinprocess' } } } it 'returns all prescriptions that are refillinprocess status' do - VCR.use_cassette('rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do + VCR.use_cassette('mobile/rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do get '/mobile/v0/health/rx/prescriptions', params:, headers: iam_headers end expect(response).to have_http_status(:ok) @@ -256,7 +249,7 @@ params = { filter: { is_refillable: { eq: 'true' }, is_trackable: { eq: 'true' } } } it 'returns all prescriptions that are both trackable and refillable' do - VCR.use_cassette('rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do + VCR.use_cassette('mobile/rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do get '/mobile/v0/health/rx/prescriptions', params:, headers: iam_headers end expect(response).to have_http_status(:ok) @@ -273,7 +266,7 @@ end it 'returns all prescriptions that are both trackable and refillable' do - VCR.use_cassette('rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do + VCR.use_cassette('mobile/rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do get '/mobile/v0/health/rx/prescriptions', params:, headers: iam_headers end expect(response).to have_http_status(:ok) @@ -288,7 +281,7 @@ params = { page: { number: 1, size: 59 }, filter: { refill_status: { not_eq: 'refillinprocess' } } } it 'returns all prescriptions that are not refillinprocess status' do - VCR.use_cassette('rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do + VCR.use_cassette('mobile/rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do get '/mobile/v0/health/rx/prescriptions', params:, headers: iam_headers end expect(response).to have_http_status(:ok) @@ -305,7 +298,7 @@ params = { filter: { quantity: { eq: '8' } } } it 'cannot filter by unexpected field' do - VCR.use_cassette('rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do + VCR.use_cassette('mobile/rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do get '/mobile/v0/health/rx/prescriptions', params:, headers: iam_headers end expect(response).to have_http_status(:bad_request) @@ -324,7 +317,7 @@ let(:params) { { sort: 'refill_status' } } it 'sorts prescriptions by ASC refill_status' do - VCR.use_cassette('rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do + VCR.use_cassette('mobile/rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do get '/mobile/v0/health/rx/prescriptions', params:, headers: iam_headers end @@ -341,7 +334,7 @@ let(:params) { { sort: '-refill_status' } } it 'sorts prescriptions by DESC refill_status' do - VCR.use_cassette('rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do + VCR.use_cassette('mobile/rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do get '/mobile/v0/health/rx/prescriptions', params:, headers: iam_headers end @@ -359,7 +352,7 @@ let(:params) { { sort: 'quantity' } } it 'sorts prescriptions by refill_status' do - VCR.use_cassette('rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do + VCR.use_cassette('mobile/rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do get '/mobile/v0/health/rx/prescriptions', params:, headers: iam_headers end @@ -379,7 +372,7 @@ params = { 'page' => { number: 2, size: 3 }, 'sort' => '-refill_date', filter: { refill_status: { eq: 'refillinprocess' } } } - VCR.use_cassette('rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do + VCR.use_cassette('mobile/rx_refill/prescriptions/gets_a_list_of_all_prescriptions') do get '/mobile/v0/health/rx/prescriptions', params:, headers: iam_headers end expect(response).to have_http_status(:ok) @@ -405,7 +398,7 @@ describe 'GET /mobile/v0/health/rx/prescriptions/:id/tracking', :aggregate_failures do context 'when id is found' do it 'returns 200' do - VCR.use_cassette('rx_refill/prescriptions/gets_tracking_for_a_prescription') do + VCR.use_cassette('mobile/rx_refill/prescriptions/gets_tracking_for_a_prescription') do get '/mobile/v0/health/rx/prescriptions/13650541/tracking', headers: iam_headers end expect(response).to have_http_status(:ok) @@ -415,7 +408,7 @@ context 'when record is not found' do it 'returns 404' do - VCR.use_cassette('rx_refill/prescriptions/tracking_error_id') do + VCR.use_cassette('mobile/rx_refill/prescriptions/tracking_error_id') do get '/mobile/v0/health/rx/prescriptions/1/tracking', headers: iam_headers end @@ -425,7 +418,7 @@ context 'with empty otherPrescriptions section' do it 'returns 200 with ' do - VCR.use_cassette('rx_refill/prescriptions/gets_tracking_with_empty_other_prescriptions') do + VCR.use_cassette('mobile/rx_refill/prescriptions/gets_tracking_with_empty_other_prescriptions') do get '/mobile/v0/health/rx/prescriptions/13650541/tracking', headers: iam_headers end diff --git a/modules/mobile/spec/request/push_get_prefs_request_spec.rb b/modules/mobile/spec/request/push_get_prefs_request_spec.rb index 68c87ba1149..200fd3ea567 100644 --- a/modules/mobile/spec/request/push_get_prefs_request_spec.rb +++ b/modules/mobile/spec/request/push_get_prefs_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'push get prefs', type: :request do diff --git a/modules/mobile/spec/request/push_register_request_spec.rb b/modules/mobile/spec/request/push_register_request_spec.rb index f6cb31a72e4..cf7b87a6409 100644 --- a/modules/mobile/spec/request/push_register_request_spec.rb +++ b/modules/mobile/spec/request/push_register_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'push register', type: :request do diff --git a/modules/mobile/spec/request/push_send_request_spec.rb b/modules/mobile/spec/request/push_send_request_spec.rb index ea9d81e13ff..cce6ea85868 100644 --- a/modules/mobile/spec/request/push_send_request_spec.rb +++ b/modules/mobile/spec/request/push_send_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'push send', type: :request do diff --git a/modules/mobile/spec/request/push_set_pref_request_spec.rb b/modules/mobile/spec/request/push_set_pref_request_spec.rb index ddbadaf87e4..56a6a23948d 100644 --- a/modules/mobile/spec/request/push_set_pref_request_spec.rb +++ b/modules/mobile/spec/request/push_set_pref_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'push send', type: :request do diff --git a/modules/mobile/spec/request/triage_teams_request_spec.rb b/modules/mobile/spec/request/triage_teams_request_spec.rb index 9be4708dfed..9dc83c290fe 100644 --- a/modules/mobile/spec/request/triage_teams_request_spec.rb +++ b/modules/mobile/spec/request/triage_teams_request_spec.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' -require_relative '../support/mobile_sm_client_helper' +require_relative '../support/helpers/iam_session_helper' +require_relative '../support/helpers/mobile_sm_client_helper' RSpec.describe 'Mobile Triage Teams Integration', type: :request do include Mobile::MessagingClientHelper diff --git a/modules/mobile/spec/request/user_request_spec.rb b/modules/mobile/spec/request/user_request_spec.rb index 97d17ba3888..60c5931f892 100644 --- a/modules/mobile/spec/request/user_request_spec.rb +++ b/modules/mobile/spec/request/user_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' require 'common/client/errors' @@ -16,18 +16,14 @@ end before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } Flipper.disable(:mobile_lighthouse_letters) end - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - context 'with no upstream errors' do before do - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities') do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities') do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v0/user', headers: iam_headers end end @@ -217,9 +213,9 @@ context 'when user object birth_date is nil' do before do iam_sign_in(FactoryBot.build(:iam_user, :no_birth_date)) - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities_no_ids', match_requests_on: %i[method uri]) do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities_no_ids', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v0/user', headers: iam_headers end end @@ -238,9 +234,9 @@ before do Flipper.disable(:mobile_lighthouse_letters) iam_sign_in(FactoryBot.build(:iam_user, :no_edipi_id)) - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities_no_ids', match_requests_on: %i[method uri]) do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities_no_ids', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v0/user', headers: iam_headers end end @@ -267,9 +263,9 @@ user = FactoryBot.build(:iam_user, :no_edipi_id) iam_sign_in(user) Flipper.enable(:mobile_lighthouse_letters, user) - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities_no_ids', match_requests_on: %i[method uri]) do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities_no_ids', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v0/user', headers: iam_headers end end @@ -296,9 +292,9 @@ before do user = FactoryBot.build(:iam_user, :no_multifactor) iam_sign_in(user) - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities', match_requests_on: %i[method uri]) do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v0/user', headers: iam_headers end end @@ -327,9 +323,9 @@ allow_any_instance_of(MHVAccountTypeService).to receive(:mhv_account_type).and_return('Premium') current_user = build(:iam_user, :mhv) iam_sign_in(current_user) - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities') do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities') do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v0/user', headers: iam_headers end end @@ -358,9 +354,9 @@ before do Flipper.disable(:mobile_lighthouse_letters) iam_sign_in(FactoryBot.build(:iam_user, :no_participant_id)) - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities_no_ids', match_requests_on: %i[method uri]) do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities_no_ids', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v0/user', headers: iam_headers end end @@ -385,9 +381,9 @@ context 'due to not having any registered faclities' do let(:user_request) do iam_sign_in(FactoryBot.build(:iam_user, :no_vha_facilities)) - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities_no_ids', match_requests_on: %i[method uri]) do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities_no_ids', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v0/user', headers: iam_headers end end @@ -409,9 +405,9 @@ context 'due to not being LOA3' do let(:user_request) do iam_sign_in(FactoryBot.build(:iam_user, :loa2)) - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities_no_ids', match_requests_on: %i[method uri]) do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities_no_ids', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v0/user', headers: iam_headers end end @@ -433,9 +429,9 @@ context 'with a user who does have access to schedule appointments' do let(:user_request) do - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities', match_requests_on: %i[method uri]) do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v0/user', headers: iam_headers end end @@ -463,7 +459,7 @@ end it 'returns a service unavailable error' do - VCR.use_cassette('user/get_facilities', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/user/get_facilities', match_requests_on: %i[method uri]) do get '/mobile/v0/user', headers: iam_headers end @@ -480,7 +476,7 @@ end it 'returns a record not found error' do - VCR.use_cassette('user/get_facilities', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/user/get_facilities', match_requests_on: %i[method uri]) do get '/mobile/v0/user', headers: iam_headers end @@ -524,7 +520,7 @@ end it 'returns a bad gateway error' do - VCR.use_cassette('user/get_facilities', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/user/get_facilities', match_requests_on: %i[method uri]) do get '/mobile/v0/user', headers: iam_headers end @@ -539,9 +535,9 @@ it 'kicks off a pre cache appointments job' do expect(Mobile::V0::PreCacheAppointmentsJob).to receive(:perform_async).once - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities', match_requests_on: %i[method uri]) do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v1/user', headers: iam_headers end end @@ -556,9 +552,9 @@ it 'does not kick off a pre cache appointments job' do expect(Mobile::V0::PreCacheAppointmentsJob).not_to receive(:perform_async) - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities', match_requests_on: %i[method uri]) do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v1/user', headers: iam_headers end end @@ -569,9 +565,9 @@ context 'empty get_facility test' do before do - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities_empty', match_requests_on: %i[method uri]) do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities_empty', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v0/user', headers: iam_headers end end @@ -602,9 +598,9 @@ context 'with no upstream errors for logingov user' do before do iam_sign_in(FactoryBot.build(:iam_user, :logingov)) - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities') do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities') do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v0/user', headers: iam_headers end end @@ -661,9 +657,9 @@ ) ) - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities') do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities') do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v0/user', headers: iam_headers end end @@ -690,9 +686,9 @@ describe 'fax number' do let(:user_request) do - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities', match_requests_on: %i[method uri]) do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v0/user', headers: iam_headers end end @@ -733,8 +729,8 @@ before do iam_sign_in(FactoryBot.build(:iam_user, :no_multifactor)) - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities') do get '/mobile/v0/user', headers: iam_headers end end diff --git a/modules/mobile/spec/request/v1/immunizations_request_spec.rb b/modules/mobile/spec/request/v1/immunizations_request_spec.rb index 6e2e5b466b0..f20fec609f5 100644 --- a/modules/mobile/spec/request/v1/immunizations_request_spec.rb +++ b/modules/mobile/spec/request/v1/immunizations_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../../support/iam_session_helper' +require_relative '../../support/helpers/iam_session_helper' require_relative '../../support/matchers/json_schema_matcher' RSpec.describe 'immunizations', type: :request do @@ -9,13 +9,6 @@ let(:rsa_key) { OpenSSL::PKey::RSA.generate(2048) } - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - before do allow(File).to receive(:read).and_return(rsa_key.to_s) allow_any_instance_of(IAMUser).to receive(:icn).and_return('9000682') @@ -28,7 +21,7 @@ describe 'GET /mobile/v1/health/immunizations' do context 'when the expected fields have data' do before do - VCR.use_cassette('lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do get '/mobile/v1/health/immunizations', headers: iam_headers, params: { page: { size: 1 } } end end @@ -73,7 +66,7 @@ context 'for items that do not have locations' do it 'has a blank relationship' do - VCR.use_cassette('lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do get '/mobile/v1/health/immunizations', headers: iam_headers, params: { page: { size: 1, number: 15 } } end @@ -92,7 +85,7 @@ context 'for items that do have a location' do it 'has a relationship' do - VCR.use_cassette('lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do get '/mobile/v1/health/immunizations', headers: iam_headers, params: { page: { size: 1, number: 13 } } end @@ -115,7 +108,7 @@ context 'when entry is missing' do before do - VCR.use_cassette('lighthouse_health/get_immunizations_no_entry', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations_no_entry', match_requests_on: %i[method uri]) do get '/mobile/v1/health/immunizations', headers: iam_headers, params: nil end end @@ -128,7 +121,7 @@ context 'when the note is null or an empty array' do before do - VCR.use_cassette('lighthouse_health/get_immunizations_blank_note', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations_blank_note', match_requests_on: %i[method uri]) do get '/mobile/v1/health/immunizations', headers: iam_headers, params: { page: { size: 15, number: 1 } } end end @@ -154,22 +147,22 @@ describe 'vaccine group name and manufacturer population' do let(:immunizations_request_non_covid_paginated) do - VCR.use_cassette('lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do get '/mobile/v1/health/immunizations', headers: iam_headers, params: { page: { size: 1, number: 13 } } end end let(:immunizations_request_covid_paginated) do - VCR.use_cassette('lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do get '/mobile/v1/health/immunizations', headers: iam_headers, params: { page: { size: 1, number: 2 } } end end let(:immunizations_request_covid_no_manufacturer_paginated) do - VCR.use_cassette('lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do get '/mobile/v1/health/immunizations', headers: iam_headers, params: { page: { size: 1, number: 1 } } end end let(:immunizations_request_non_covid_with_manufacturer_paginated) do - VCR.use_cassette('lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do get '/mobile/v1/health/immunizations', headers: iam_headers, params: { page: { size: 1, number: 6 } } end end @@ -265,7 +258,7 @@ describe 'pagination' do it 'defaults to the first page with ten results per page', :aggregate_failures do - VCR.use_cassette('lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do get '/mobile/v1/health/immunizations', headers: iam_headers, params: nil end @@ -288,7 +281,7 @@ end it 'returns the correct page and number of records' do - VCR.use_cassette('lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do get '/mobile/v1/health/immunizations', headers: iam_headers, params: { page: { size: 2, number: 3 } } end @@ -301,7 +294,7 @@ describe 'record order' do it 'orders records by descending date' do - VCR.use_cassette('lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do get '/mobile/v1/health/immunizations', headers: iam_headers, params: { page: { size: 15, number: 1 } } end @@ -332,7 +325,7 @@ it 'calls service' do expect_any_instance_of(Mobile::V0::LighthouseHealth::Service).to receive(:get_immunizations) - VCR.use_cassette('lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do get '/mobile/v1/health/immunizations', headers: iam_headers, params: {} end end @@ -340,7 +333,7 @@ it 'calls service even when useCache is true' do expect_any_instance_of(Mobile::V0::LighthouseHealth::Service).to receive(:get_immunizations) - VCR.use_cassette('lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do get '/mobile/v1/health/immunizations', headers: iam_headers, params: { useCache: true } end end @@ -348,7 +341,7 @@ context 'when cache is set' do before do - VCR.use_cassette('lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do get '/mobile/v1/health/immunizations', headers: iam_headers, params: {} end end @@ -356,7 +349,7 @@ it 'uses cached data instead of calling service' do expect_any_instance_of(Mobile::V0::LighthouseHealth::Service).not_to receive(:get_immunizations) - VCR.use_cassette('lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do get '/mobile/v1/health/immunizations', headers: iam_headers, params: {} end end @@ -364,7 +357,7 @@ it 'does not use cache when useCache is false' do expect_any_instance_of(Mobile::V0::LighthouseHealth::Service).to receive(:get_immunizations) - VCR.use_cassette('lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do get '/mobile/v1/health/immunizations', headers: iam_headers, params: { useCache: false } end end @@ -374,7 +367,7 @@ describe 'when multiple items have same date' do context 'date is available' do it 'returns items in alphabetical order by group name' do - VCR.use_cassette('lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do get '/mobile/v1/health/immunizations', headers: iam_headers, params: { page: { size: 10 } } end expect(response.parsed_body['data'][4]['attributes']).to eq( @@ -410,7 +403,8 @@ context 'date is missing' do it 'returns items in alphabetical order by group name with missing date items at end of list' do - VCR.use_cassette('lighthouse_health/get_immunizations_date_missing', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations_date_missing', + match_requests_on: %i[method uri]) do get '/mobile/v1/health/immunizations', headers: iam_headers, params: { page: { size: 4 } } end expect(response.parsed_body['data'][0]['attributes']).to eq( diff --git a/modules/mobile/spec/request/v1/messages_request_spec.rb b/modules/mobile/spec/request/v1/messages_request_spec.rb index 49a9de7ad71..3dd2b893b8c 100644 --- a/modules/mobile/spec/request/v1/messages_request_spec.rb +++ b/modules/mobile/spec/request/v1/messages_request_spec.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../../support/iam_session_helper' -require_relative '../../support/mobile_sm_client_helper' +require_relative '../../support/helpers/iam_session_helper' +require_relative '../../support/helpers/mobile_sm_client_helper' require_relative '../../support/matchers/json_schema_matcher' RSpec.describe 'Mobile Messages V1 Integration', type: :request do diff --git a/modules/mobile/spec/request/v1/user_request_spec.rb b/modules/mobile/spec/request/v1/user_request_spec.rb index fd105253b35..be0788cf340 100644 --- a/modules/mobile/spec/request/v1/user_request_spec.rb +++ b/modules/mobile/spec/request/v1/user_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../../support/iam_session_helper' +require_relative '../../support/helpers/iam_session_helper' require_relative '../../support/matchers/json_schema_matcher' require 'common/client/errors' @@ -13,18 +13,11 @@ iam_sign_in(build(:iam_user)) end - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - context 'with no upstream errors' do before do - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities') do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities') do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v1/user', headers: iam_headers end end @@ -223,9 +216,9 @@ context 'when user object birth_date is nil' do before do iam_sign_in(FactoryBot.build(:iam_user, :no_birth_date)) - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities_no_ids', match_requests_on: %i[method uri]) do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities_no_ids', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v1/user', headers: iam_headers end end @@ -244,9 +237,9 @@ before do Flipper.disable(:mobile_lighthouse_letters) iam_sign_in(FactoryBot.build(:iam_user, :no_edipi_id)) - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities_no_ids', match_requests_on: %i[method uri]) do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities_no_ids', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v1/user', headers: iam_headers end end @@ -272,9 +265,9 @@ before do user = FactoryBot.build(:iam_user, :no_multifactor) iam_sign_in(user) - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities', match_requests_on: %i[method uri]) do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v1/user', headers: iam_headers end end @@ -303,9 +296,9 @@ allow_any_instance_of(MHVAccountTypeService).to receive(:mhv_account_type).and_return('Premium') current_user = build(:iam_user, :mhv) iam_sign_in(current_user) - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities') do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities') do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v0/user', headers: iam_headers end end @@ -334,9 +327,9 @@ before do Flipper.disable(:mobile_lighthouse_letters) iam_sign_in(FactoryBot.build(:iam_user, :no_participant_id)) - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities_no_ids', match_requests_on: %i[method uri]) do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities_no_ids', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v1/user', headers: iam_headers end end @@ -361,9 +354,9 @@ context 'due to not having any registered faclities' do let(:user_request) do iam_sign_in(FactoryBot.build(:iam_user, :no_vha_facilities)) - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities_no_ids', match_requests_on: %i[method uri]) do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities_no_ids', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v0/user', headers: iam_headers end end @@ -385,9 +378,9 @@ context 'due to not being LOA3' do let(:user_request) do iam_sign_in(FactoryBot.build(:iam_user, :loa2)) - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities_no_ids', match_requests_on: %i[method uri]) do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities_no_ids', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v0/user', headers: iam_headers end end @@ -409,9 +402,9 @@ context 'with a user who does have access to schedule appointments' do let(:user_request) do - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities', match_requests_on: %i[method uri]) do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v0/user', headers: iam_headers end end @@ -439,7 +432,7 @@ end it 'returns a service unavailable error' do - VCR.use_cassette('user/get_facilities', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/user/get_facilities', match_requests_on: %i[method uri]) do get '/mobile/v1/user', headers: iam_headers end @@ -456,7 +449,7 @@ end it 'returns a record not found error' do - VCR.use_cassette('user/get_facilities', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/user/get_facilities', match_requests_on: %i[method uri]) do get '/mobile/v1/user', headers: iam_headers end @@ -500,7 +493,7 @@ end it 'returns a bad gateway error' do - VCR.use_cassette('user/get_facilities', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/user/get_facilities', match_requests_on: %i[method uri]) do get '/mobile/v1/user', headers: iam_headers end @@ -513,9 +506,9 @@ let(:authorized_services) { response.parsed_body.dig('data', 'attributes', 'authorizedServices') } it 'returns an ok response with no directDepositBenefitsUpdate permission' do - VCR.use_cassette('payment_information/service_error_500') do - VCR.use_cassette('user/get_facilities') do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/service_error_500') do + VCR.use_cassette('mobile/user/get_facilities') do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v1/user', headers: iam_headers end end @@ -539,9 +532,9 @@ context 'when the ppiu service throws a 502' do before do - VCR.use_cassette('payment_information/service_error_502') do - VCR.use_cassette('user/get_facilities') do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/service_error_502') do + VCR.use_cassette('mobile/user/get_facilities') do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v1/user', headers: iam_headers end end @@ -573,9 +566,9 @@ it 'kicks off a pre cache appointments job' do expect(Mobile::V0::PreCacheAppointmentsJob).to receive(:perform_async).once - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities', match_requests_on: %i[method uri]) do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v1/user', headers: iam_headers end end @@ -590,8 +583,8 @@ it 'does not kick off a pre cache appointments job' do expect(Mobile::V0::PreCacheAppointmentsJob).not_to receive(:perform_async) - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities', match_requests_on: %i[method uri]) do get '/mobile/v1/user', headers: iam_headers end end @@ -601,9 +594,9 @@ context 'empty get_facility test' do before do - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities_empty', match_requests_on: %i[method uri]) do - VCR.use_cassette('va_profile/demographics/demographics') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities_empty', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_profile/demographics/demographics') do get '/mobile/v1/user', headers: iam_headers end end @@ -639,9 +632,9 @@ allow_any_instance_of(IAMUser).to receive(:idme_uuid).and_return(nil) allow_any_instance_of(IAMUser).to receive(:logingov_uuid).and_return('b2fab2b5-6af0-45e1-a9e2-394347af91ef') - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities') do - VCR.use_cassette('va_profile/demographics/logingov') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities') do + VCR.use_cassette('mobile/va_profile/demographics/logingov') do get '/mobile/v1/user', headers: iam_headers end end @@ -687,8 +680,8 @@ before do iam_sign_in(FactoryBot.build(:iam_user, :no_multifactor)) - VCR.use_cassette('payment_information/payment_information') do - VCR.use_cassette('user/get_facilities') do + VCR.use_cassette('mobile/payment_information/payment_information') do + VCR.use_cassette('mobile/user/get_facilities') do get '/mobile/v1/user', headers: iam_headers end end diff --git a/modules/mobile/spec/request/veterans_affairs_eligibility_request_spec.rb b/modules/mobile/spec/request/veterans_affairs_eligibility_request_spec.rb index a813a853fbd..bd09e385bf8 100644 --- a/modules/mobile/spec/request/veterans_affairs_eligibility_request_spec.rb +++ b/modules/mobile/spec/request/veterans_affairs_eligibility_request_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' require_relative '../support/matchers/json_schema_matcher' RSpec.describe 'veterans Affairs Eligibility', type: :request do @@ -9,13 +9,6 @@ let(:rsa_key) { OpenSSL::PKey::RSA.generate(2048) } - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - before do allow_any_instance_of(IAMUser).to receive(:icn).and_return('9000682') iam_sign_in(build(:iam_user)) @@ -28,7 +21,8 @@ let(:params) { { facilityIds: ['489'] } } before do - VCR.use_cassette('va_eligibility/get_scheduling_configurations_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_eligibility/get_scheduling_configurations_200', + match_requests_on: %i[method uri]) do get '/mobile/v0/appointments/va/eligibility', params:, headers: iam_headers end end @@ -101,7 +95,8 @@ let(:params) { { facilityIds: %w[489 984] } } before do - VCR.use_cassette('va_eligibility/get_scheduling_configurations_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/va_eligibility/get_scheduling_configurations_200', + match_requests_on: %i[method uri]) do get '/mobile/v0/appointments/va/eligibility', params:, headers: iam_headers end end @@ -174,7 +169,7 @@ let(:params) { { facilityIds: ['489'] } } before do - VCR.use_cassette('va_eligibility/get_scheduling_configurations_200_all_enabled', + VCR.use_cassette('mobile/va_eligibility/get_scheduling_configurations_200_all_enabled', match_requests_on: %i[method uri]) do get '/mobile/v0/appointments/va/eligibility', params:, headers: iam_headers end @@ -244,7 +239,7 @@ let(:params) { { facilityIds: ['12345678'] } } before do - VCR.use_cassette('va_eligibility/get_scheduling_configurations_200_bad_facility', + VCR.use_cassette('mobile/va_eligibility/get_scheduling_configurations_200_bad_facility', match_requests_on: %i[method uri]) do get '/mobile/v0/appointments/va/eligibility', params:, headers: iam_headers end diff --git a/modules/mobile/spec/services/lighthouse_health_service_spec.rb b/modules/mobile/spec/services/lighthouse_health_service_spec.rb index 1af922e7d00..ba9d6fa097b 100644 --- a/modules/mobile/spec/services/lighthouse_health_service_spec.rb +++ b/modules/mobile/spec/services/lighthouse_health_service_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' describe Mobile::V0::LighthouseHealth::Service do let(:user) { FactoryBot.build(:iam_user) } @@ -73,13 +73,6 @@ } end - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - before do allow(File).to receive(:read).and_return(rsa_key.to_s) allow_any_instance_of(IAMUser).to receive(:icn).and_return('9000682') @@ -92,7 +85,7 @@ describe '#get_immunizations' do context 'when an access_token is not cached' do let!(:response) do - VCR.use_cassette('lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations', match_requests_on: %i[method uri]) do service.get_immunizations end end @@ -118,7 +111,8 @@ end let!(:response) do - VCR.use_cassette('lighthouse_health/get_immunizations_cached_token', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/lighthouse_health/get_immunizations_cached_token', + match_requests_on: %i[method uri]) do service.get_immunizations end end diff --git a/modules/mobile/spec/services/sync_update_service_spec.rb b/modules/mobile/spec/services/sync_update_service_spec.rb index 3fd6d4c26fc..1e4ec89eebb 100644 --- a/modules/mobile/spec/services/sync_update_service_spec.rb +++ b/modules/mobile/spec/services/sync_update_service_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' describe Mobile::V0::Profile::SyncUpdateService do let(:user) { FactoryBot.build(:iam_user) } @@ -9,21 +9,14 @@ before { iam_sign_in(user) } - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - describe '#save_and_await_response' do let(:params) { build(:va_profile_address, vet360_id: user.vet360_id, validation_key: nil) } context 'when it succeeds after one incomplete status check' do let(:transaction) do - VCR.use_cassette('profile/get_address_status_complete') do - VCR.use_cassette('profile/get_address_status_incomplete') do - VCR.use_cassette('profile/put_address_initial') do + VCR.use_cassette('mobile/profile/get_address_status_complete') do + VCR.use_cassette('mobile/profile/get_address_status_incomplete') do + VCR.use_cassette('mobile/profile/put_address_initial') do service.save_and_await_response(resource_type: :address, params:, update: true) end end @@ -41,10 +34,10 @@ context 'when it succeeds after two incomplete checks' do let(:transaction) do - VCR.use_cassette('profile/get_address_status_complete') do - VCR.use_cassette('profile/get_address_status_incomplete_2') do - VCR.use_cassette('profile/get_address_status_incomplete') do - VCR.use_cassette('profile/put_address_initial') do + VCR.use_cassette('mobile/profile/get_address_status_complete') do + VCR.use_cassette('mobile/profile/get_address_status_incomplete_2') do + VCR.use_cassette('mobile/profile/get_address_status_incomplete') do + VCR.use_cassette('mobile/profile/put_address_initial') do service.save_and_await_response(resource_type: :address, params:, update: true) end end @@ -67,10 +60,10 @@ end it 'raises a gateway timeout error' do - VCR.use_cassette('profile/get_address_status_complete') do - VCR.use_cassette('profile/get_address_status_incomplete_2') do - VCR.use_cassette('profile/get_address_status_incomplete') do - VCR.use_cassette('profile/put_address_initial') do + VCR.use_cassette('mobile/profile/get_address_status_complete') do + VCR.use_cassette('mobile/profile/get_address_status_incomplete_2') do + VCR.use_cassette('mobile/profile/get_address_status_incomplete') do + VCR.use_cassette('mobile/profile/put_address_initial') do expect { service.save_and_await_response(resource_type: :address, params:, update: true) } .to raise_error(Common::Exceptions::GatewayTimeout) end @@ -82,8 +75,8 @@ context 'when it fails on a status check returning an error' do it 'raises a backend service exception' do - VCR.use_cassette('profile/get_address_status_error') do - VCR.use_cassette('profile/put_address_initial') do + VCR.use_cassette('mobile/profile/get_address_status_error') do + VCR.use_cassette('mobile/profile/put_address_initial') do expect { service.save_and_await_response(resource_type: :address, params:, update: true) } .to raise_error(Common::Exceptions::BackendServiceException) end diff --git a/modules/mobile/spec/support/iam_session_helper.rb b/modules/mobile/spec/support/helpers/iam_session_helper.rb similarity index 85% rename from modules/mobile/spec/support/iam_session_helper.rb rename to modules/mobile/spec/support/helpers/iam_session_helper.rb index 1e896ed7fb1..932b79d8239 100644 --- a/modules/mobile/spec/support/iam_session_helper.rb +++ b/modules/mobile/spec/support/helpers/iam_session_helper.rb @@ -2,6 +2,8 @@ module IAMSessionHelper DEFAULT_ACCESS_TOKEN = 'ypXeAwQedpmAy5xFD2u5' + OPENSSL_X509_CERTIFICATE = 'OpenSSL::X509::Certificate' + OPENSSL_PKEY_RSA = 'OpenSSL::PKey::RSA' def access_token DEFAULT_ACCESS_TOKEN @@ -24,9 +26,9 @@ def iam_headers_no_camel(additional_headers = nil) def stub_iam_certs allow(IAMSSOeOAuth::Configuration.instance).to receive(:ssl_cert) - .and_return(instance_double('OpenSSL::X509::Certificate')) + .and_return(instance_double(OPENSSL_X509_CERTIFICATE)) allow(IAMSSOeOAuth::Configuration.instance).to receive(:ssl_key) - .and_return(instance_double('OpenSSL::PKey::RSA')) + .and_return(instance_double(OPENSSL_PKEY_RSA)) end def iam_sign_in(iam_user = FactoryBot.build(:iam_user), access_token = nil) diff --git a/modules/mobile/spec/support/mobile_sm_client_helper.rb b/modules/mobile/spec/support/helpers/mobile_sm_client_helper.rb similarity index 93% rename from modules/mobile/spec/support/mobile_sm_client_helper.rb rename to modules/mobile/spec/support/helpers/mobile_sm_client_helper.rb index e5f023a83d8..2c6d56877ab 100644 --- a/modules/mobile/spec/support/mobile_sm_client_helper.rb +++ b/modules/mobile/spec/support/helpers/mobile_sm_client_helper.rb @@ -8,7 +8,7 @@ module MessagingClientHelper def authenticated_client Mobile::V0::Messaging::Client.new(session: { user_id: 123, - expires_at: Time.current + 60 * 60, + expires_at: Time.current + (60 * 60), token: TOKEN }) end end diff --git a/modules/mobile/spec/support/sis_session_helper.rb b/modules/mobile/spec/support/helpers/sis_session_helper.rb similarity index 100% rename from modules/mobile/spec/support/sis_session_helper.rb rename to modules/mobile/spec/support/helpers/sis_session_helper.rb diff --git a/modules/mobile/spec/workers/pre_cache_appointments_job_spec.rb b/modules/mobile/spec/workers/pre_cache_appointments_job_spec.rb index 73dd96af4b2..1d279d61eef 100644 --- a/modules/mobile/spec/workers/pre_cache_appointments_job_spec.rb +++ b/modules/mobile/spec/workers/pre_cache_appointments_job_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' RSpec.describe Mobile::V0::PreCacheAppointmentsJob, type: :job do let(:user) { create(:user, :loa3, icn: '1012846043V576341') } @@ -12,12 +12,6 @@ allow(Rails).to receive(:cache).and_return(ActiveSupport::Cache::MemoryStore.new) end - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } after { allow(Rails).to receive(:cache).and_return(ActiveSupport::Cache::NullStore.new) } describe '.perform_async' do @@ -26,9 +20,9 @@ after { Timecop.return } it 'caches the user\'s appointments' do - VCR.use_cassette('appointments/VAOS_v2/get_facility_200', match_requests_on: %i[method uri]) do - VCR.use_cassette('appointments/VAOS_v2/get_clinic_200', match_requests_on: %i[method uri]) do - VCR.use_cassette('appointments/VAOS_v2/get_appointment_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/VAOS_v2/get_facility_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/VAOS_v2/get_clinic_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/VAOS_v2/get_appointment_200', match_requests_on: %i[method uri]) do expect(Mobile::V0::Appointment.get_cached(user)).to be_nil subject.perform(user.uuid) @@ -40,9 +34,9 @@ end it 'doesn\'t caches the user\'s appointments when failures are encountered' do - VCR.use_cassette('appointments/VAOS_v2/get_facility_200', match_requests_on: %i[method uri]) do - VCR.use_cassette('appointments/VAOS_v2/get_clinic_200', match_requests_on: %i[method uri]) do - VCR.use_cassette('appointments/VAOS_v2/get_appointment_200_partial_error', + VCR.use_cassette('mobile/appointments/VAOS_v2/get_facility_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/VAOS_v2/get_clinic_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/VAOS_v2/get_appointment_200_partial_error', match_requests_on: %i[method uri]) do expect(Mobile::V0::Appointment.get_cached(user)).to be_nil @@ -76,9 +70,9 @@ end it 'caches the user\'s appointments' do - VCR.use_cassette('appointments/VAOS_v2/get_facility_200', match_requests_on: %i[method uri]) do - VCR.use_cassette('appointments/VAOS_v2/get_clinic_200', match_requests_on: %i[method uri]) do - VCR.use_cassette('appointments/VAOS_v2/get_appointment_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/VAOS_v2/get_facility_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/VAOS_v2/get_clinic_200', match_requests_on: %i[method uri]) do + VCR.use_cassette('mobile/appointments/VAOS_v2/get_appointment_200', match_requests_on: %i[method uri]) do expect(Mobile::V0::Appointment.get_cached(user)).to be_nil subject.perform(user.uuid) diff --git a/modules/mobile/spec/workers/pre_cache_claims_and_appeals_job_spec.rb b/modules/mobile/spec/workers/pre_cache_claims_and_appeals_job_spec.rb index c5ba26eaac6..5fda84daa69 100644 --- a/modules/mobile/spec/workers/pre_cache_claims_and_appeals_job_spec.rb +++ b/modules/mobile/spec/workers/pre_cache_claims_and_appeals_job_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' RSpec.describe Mobile::V0::PreCacheClaimsAndAppealsJob, type: :job do before do @@ -9,19 +9,15 @@ end before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } Flipper.disable(:mobile_lighthouse_claims) end - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - describe '.perform_async' do let(:user) { create(:user, :loa3) } it 'caches the expected claims and appeals' do - VCR.use_cassette('claims/claims') do - VCR.use_cassette('appeals/appeals') do + VCR.use_cassette('mobile/claims/claims') do + VCR.use_cassette('mobile/appeals/appeals') do expect(Mobile::V0::ClaimOverview.get_cached(user)).to be_nil subject.perform(user.uuid) expect(Mobile::V0::ClaimOverview.get_cached(user).first.to_h).to eq( @@ -41,8 +37,8 @@ end it 'logs a warning with details when fetch fails' do - VCR.use_cassette('claims/claims_with_errors') do - VCR.use_cassette('appeals/appeals') do + VCR.use_cassette('mobile/claims/claims_with_errors') do + VCR.use_cassette('mobile/appeals/appeals') do expect(Rails.logger).to receive(:warn).with( 'mobile claims pre-cache set failed', { errors: [{ error_details: [{ 'key' => 'EVSS_7022', @@ -65,8 +61,8 @@ before { iam_sign_in(user) } it 'caches the expected claims and appeals' do - VCR.use_cassette('claims/claims') do - VCR.use_cassette('appeals/appeals') do + VCR.use_cassette('mobile/claims/claims') do + VCR.use_cassette('mobile/appeals/appeals') do expect(Mobile::V0::ClaimOverview.get_cached(user)).to be_nil subject.perform(user.uuid) expect(Mobile::V0::ClaimOverview.get_cached(user).first.to_h).to eq( diff --git a/modules/mobile/spec/workers/vet360_linking_spec.rb b/modules/mobile/spec/workers/vet360_linking_spec.rb index 43106b990d0..9078baf6264 100644 --- a/modules/mobile/spec/workers/vet360_linking_spec.rb +++ b/modules/mobile/spec/workers/vet360_linking_spec.rb @@ -1,22 +1,15 @@ # frozen_string_literal: true require 'rails_helper' -require_relative '../support/iam_session_helper' +require_relative '../support/helpers/iam_session_helper' RSpec.describe Mobile::V0::Vet360LinkingJob, type: :job do let(:user) { create(:user, :loa3) } - before(:all) do - @original_cassette_dir = VCR.configure(&:cassette_library_dir) - VCR.configure { |c| c.cassette_library_dir = 'modules/mobile/spec/support/vcr_cassettes' } - end - - after(:all) { VCR.configure { |c| c.cassette_library_dir = @original_cassette_dir } } - context 'when linking succeeds' do it 'logs the completed transaction id that linked an account with vet360' do - VCR.use_cassette('profile/init_vet360_id_status_complete') do - VCR.use_cassette('profile/init_vet360_id_success') do + VCR.use_cassette('mobile/profile/init_vet360_id_status_complete') do + VCR.use_cassette('mobile/profile/init_vet360_id_success') do allow(Rails.logger).to receive(:info).with( 'mobile syncronous profile update complete', { transaction_id: 'd8951c96-5b8c-42ea-9fbe-e656941b7236' } @@ -33,7 +26,7 @@ context 'when linking fails' do it 'logs the failure with the user uuid' do - VCR.use_cassette('profile/init_vet360_id_status_400') do + VCR.use_cassette('mobile/profile/init_vet360_id_status_400') do expect(Rails.logger).to receive(:error).with( 'Mobile Vet360 account linking failed for user with uuid', { user_uuid: user.uuid } ) @@ -48,8 +41,8 @@ before { iam_sign_in(FactoryBot.build(:iam_user, :no_vet360_id)) } it 'works as expected' do - VCR.use_cassette('profile/init_vet360_id_status_complete') do - VCR.use_cassette('profile/init_vet360_id_success') do + VCR.use_cassette('mobile/profile/init_vet360_id_status_complete') do + VCR.use_cassette('mobile/profile/init_vet360_id_success') do allow(Rails.logger).to receive(:info).with( 'mobile syncronous profile update complete', { transaction_id: 'd8951c96-5b8c-42ea-9fbe-e656941b7236' } diff --git a/modules/mobile/spec/support/vcr_cassettes/appeals/appeals.yml b/spec/support/vcr_cassettes/mobile/appeals/appeals.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appeals/appeals.yml rename to spec/support/vcr_cassettes/mobile/appeals/appeals.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appeals/server_error.yml b/spec/support/vcr_cassettes/mobile/appeals/server_error.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appeals/server_error.yml rename to spec/support/vcr_cassettes/mobile/appeals/server_error.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/cancel_appointment_200.yml b/spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/cancel_appointment_200.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/cancel_appointment_200.yml rename to spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/cancel_appointment_200.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/cancel_appointment_400.yml b/spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/cancel_appointment_400.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/cancel_appointment_400.yml rename to spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/cancel_appointment_400.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/cancel_appointment_500.yml b/spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/cancel_appointment_500.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/cancel_appointment_500.yml rename to spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/cancel_appointment_500.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_all_appointment_200_ruben.yml b/spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/get_all_appointment_200_ruben.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_all_appointment_200_ruben.yml rename to spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/get_all_appointment_200_ruben.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointment_200.yml b/spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/get_appointment_200.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointment_200.yml rename to spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/get_appointment_200.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointment_200_bad_facility_id.yml b/spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/get_appointment_200_bad_facility_id.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointment_200_bad_facility_id.yml rename to spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/get_appointment_200_bad_facility_id.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointment_200_partial_error.yml b/spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/get_appointment_200_partial_error.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointment_200_partial_error.yml rename to spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/get_appointment_200_partial_error.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointments_no_requests_200.yml b/spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/get_appointments_no_requests_200.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointments_no_requests_200.yml rename to spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/get_appointments_no_requests_200.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointments_with_mixed_provider_types.yml b/spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/get_appointments_with_mixed_provider_types.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_appointments_with_mixed_provider_types.yml rename to spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/get_appointments_with_mixed_provider_types.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_clinic_200.yml b/spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/get_clinic_200.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_clinic_200.yml rename to spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/get_clinic_200.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_clinic_bad_facility_id_500.yml b/spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/get_clinic_bad_facility_id_500.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_clinic_bad_facility_id_500.yml rename to spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/get_clinic_bad_facility_id_500.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_facility_200.yml b/spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/get_facility_200.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_facility_200.yml rename to spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/get_facility_200.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_facility_400.yml b/spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/get_facility_400.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_facility_400.yml rename to spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/get_facility_400.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_facility_500.yml b/spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/get_facility_500.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/VAOS_v2/get_facility_500.yml rename to spec/support/vcr_cassettes/mobile/appointments/VAOS_v2/get_facility_500.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/get_appointments_cache_false.yml b/spec/support/vcr_cassettes/mobile/appointments/get_appointments_cache_false.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/get_appointments_cache_false.yml rename to spec/support/vcr_cassettes/mobile/appointments/get_appointments_cache_false.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/get_available_slots_200.yml b/spec/support/vcr_cassettes/mobile/appointments/get_available_slots_200.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/get_available_slots_200.yml rename to spec/support/vcr_cassettes/mobile/appointments/get_available_slots_200.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/get_available_slots_200_no_start_end_date.yml b/spec/support/vcr_cassettes/mobile/appointments/get_available_slots_200_no_start_end_date.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/get_available_slots_200_no_start_end_date.yml rename to spec/support/vcr_cassettes/mobile/appointments/get_available_slots_200_no_start_end_date.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/get_available_slots_500.yml b/spec/support/vcr_cassettes/mobile/appointments/get_available_slots_500.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/get_available_slots_500.yml rename to spec/support/vcr_cassettes/mobile/appointments/get_available_slots_500.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/get_facilities.yml b/spec/support/vcr_cassettes/mobile/appointments/get_facilities.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/get_facilities.yml rename to spec/support/vcr_cassettes/mobile/appointments/get_facilities.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/get_facility_clinics_200.yml b/spec/support/vcr_cassettes/mobile/appointments/get_facility_clinics_200.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/get_facility_clinics_200.yml rename to spec/support/vcr_cassettes/mobile/appointments/get_facility_clinics_200.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/get_facility_clinics_bad_facility_id_200.yml b/spec/support/vcr_cassettes/mobile/appointments/get_facility_clinics_bad_facility_id_200.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/get_facility_clinics_bad_facility_id_200.yml rename to spec/support/vcr_cassettes/mobile/appointments/get_facility_clinics_bad_facility_id_200.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/get_facility_clinics_bad_service_400.yml b/spec/support/vcr_cassettes/mobile/appointments/get_facility_clinics_bad_service_400.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/get_facility_clinics_bad_service_400.yml rename to spec/support/vcr_cassettes/mobile/appointments/get_facility_clinics_bad_service_400.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/get_multiple_facilities_200.yml b/spec/support/vcr_cassettes/mobile/appointments/get_multiple_facilities_200.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/get_multiple_facilities_200.yml rename to spec/support/vcr_cassettes/mobile/appointments/get_multiple_facilities_200.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/get_multiple_mfs_facilities_200.yml b/spec/support/vcr_cassettes/mobile/appointments/get_multiple_mfs_facilities_200.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/get_multiple_mfs_facilities_200.yml rename to spec/support/vcr_cassettes/mobile/appointments/get_multiple_mfs_facilities_200.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/get_preferences.yml b/spec/support/vcr_cassettes/mobile/appointments/get_preferences.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/get_preferences.yml rename to spec/support/vcr_cassettes/mobile/appointments/get_preferences.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/legacy_get_facilities_for_facilities_info.yml b/spec/support/vcr_cassettes/mobile/appointments/legacy_get_facilities_for_facilities_info.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/legacy_get_facilities_for_facilities_info.yml rename to spec/support/vcr_cassettes/mobile/appointments/legacy_get_facilities_for_facilities_info.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/post_appointments_400.yml b/spec/support/vcr_cassettes/mobile/appointments/post_appointments_400.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/post_appointments_400.yml rename to spec/support/vcr_cassettes/mobile/appointments/post_appointments_400.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/post_appointments_cc_200_2222022.yml b/spec/support/vcr_cassettes/mobile/appointments/post_appointments_cc_200_2222022.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/post_appointments_cc_200_2222022.yml rename to spec/support/vcr_cassettes/mobile/appointments/post_appointments_cc_200_2222022.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/post_appointments_va_booked_200_JACQUELINE_M.yml b/spec/support/vcr_cassettes/mobile/appointments/post_appointments_va_booked_200_JACQUELINE_M.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/post_appointments_va_booked_200_JACQUELINE_M.yml rename to spec/support/vcr_cassettes/mobile/appointments/post_appointments_va_booked_200_JACQUELINE_M.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/post_appointments_va_proposed_clinic_200.yml b/spec/support/vcr_cassettes/mobile/appointments/post_appointments_va_proposed_clinic_200.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/post_appointments_va_proposed_clinic_200.yml rename to spec/support/vcr_cassettes/mobile/appointments/post_appointments_va_proposed_clinic_200.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/put_preferences.yml b/spec/support/vcr_cassettes/mobile/appointments/put_preferences.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/put_preferences.yml rename to spec/support/vcr_cassettes/mobile/appointments/put_preferences.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/appointments/put_preferences_minimal_payload.yml b/spec/support/vcr_cassettes/mobile/appointments/put_preferences_minimal_payload.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/appointments/put_preferences_minimal_payload.yml rename to spec/support/vcr_cassettes/mobile/appointments/put_preferences_minimal_payload.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/cc_eligibility/get_eligibility_400.yml b/spec/support/vcr_cassettes/mobile/cc_eligibility/get_eligibility_400.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/cc_eligibility/get_eligibility_400.yml rename to spec/support/vcr_cassettes/mobile/cc_eligibility/get_eligibility_400.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/cc_eligibility/get_eligibility_false.yml b/spec/support/vcr_cassettes/mobile/cc_eligibility/get_eligibility_false.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/cc_eligibility/get_eligibility_false.yml rename to spec/support/vcr_cassettes/mobile/cc_eligibility/get_eligibility_false.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/cc_eligibility/get_eligibility_true.yml b/spec/support/vcr_cassettes/mobile/cc_eligibility/get_eligibility_true.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/cc_eligibility/get_eligibility_true.yml rename to spec/support/vcr_cassettes/mobile/cc_eligibility/get_eligibility_true.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/claims/claims.yml b/spec/support/vcr_cassettes/mobile/claims/claims.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/claims/claims.yml rename to spec/support/vcr_cassettes/mobile/claims/claims.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/claims/claims_with_errors.yml b/spec/support/vcr_cassettes/mobile/claims/claims_with_errors.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/claims/claims_with_errors.yml rename to spec/support/vcr_cassettes/mobile/claims/claims_with_errors.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/facilities/ppms/community_clinics_empty_search.yml b/spec/support/vcr_cassettes/mobile/facilities/ppms/community_clinics_empty_search.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/facilities/ppms/community_clinics_empty_search.yml rename to spec/support/vcr_cassettes/mobile/facilities/ppms/community_clinics_empty_search.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/facilities/ppms/community_clinics_near_facility.yml b/spec/support/vcr_cassettes/mobile/facilities/ppms/community_clinics_near_facility.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/facilities/ppms/community_clinics_near_facility.yml rename to spec/support/vcr_cassettes/mobile/facilities/ppms/community_clinics_near_facility.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/facilities/ppms/community_clinics_near_user.yml b/spec/support/vcr_cassettes/mobile/facilities/ppms/community_clinics_near_user.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/facilities/ppms/community_clinics_near_user.yml rename to spec/support/vcr_cassettes/mobile/facilities/ppms/community_clinics_near_user.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/facility_eligibility/get_patient_appointment_metadata_bad_facility.yml b/spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_bad_facility.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/facility_eligibility/get_patient_appointment_metadata_bad_facility.yml rename to spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_bad_facility.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/facility_eligibility/get_patient_appointment_metadata_facility_100.yml b/spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_facility_100.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/facility_eligibility/get_patient_appointment_metadata_facility_100.yml rename to spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_facility_100.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/facility_eligibility/get_patient_appointment_metadata_facility_101.yml b/spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_facility_101.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/facility_eligibility/get_patient_appointment_metadata_facility_101.yml rename to spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_facility_101.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/facility_eligibility/get_patient_appointment_metadata_facility_102.yml b/spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_facility_102.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/facility_eligibility/get_patient_appointment_metadata_facility_102.yml rename to spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_facility_102.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/facility_eligibility/get_patient_appointment_metadata_facility_103.yml b/spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_facility_103.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/facility_eligibility/get_patient_appointment_metadata_facility_103.yml rename to spec/support/vcr_cassettes/mobile/facility_eligibility/get_patient_appointment_metadata_facility_103.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/lighthouse_claims/index/200_response.yml b/spec/support/vcr_cassettes/mobile/lighthouse_claims/index/200_response.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/lighthouse_claims/index/200_response.yml rename to spec/support/vcr_cassettes/mobile/lighthouse_claims/index/200_response.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/lighthouse_claims/index/404_response.yml b/spec/support/vcr_cassettes/mobile/lighthouse_claims/index/404_response.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/lighthouse_claims/index/404_response.yml rename to spec/support/vcr_cassettes/mobile/lighthouse_claims/index/404_response.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/lighthouse_claims/show/200_response.yml b/spec/support/vcr_cassettes/mobile/lighthouse_claims/show/200_response.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/lighthouse_claims/show/200_response.yml rename to spec/support/vcr_cassettes/mobile/lighthouse_claims/show/200_response.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/lighthouse_claims/show/404_response.yml b/spec/support/vcr_cassettes/mobile/lighthouse_claims/show/404_response.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/lighthouse_claims/show/404_response.yml rename to spec/support/vcr_cassettes/mobile/lighthouse_claims/show/404_response.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_facilities_empty.yml b/spec/support/vcr_cassettes/mobile/lighthouse_health/get_facilities_empty.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_facilities_empty.yml rename to spec/support/vcr_cassettes/mobile/lighthouse_health/get_facilities_empty.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_facility.yml b/spec/support/vcr_cassettes/mobile/lighthouse_health/get_facility.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_facility.yml rename to spec/support/vcr_cassettes/mobile/lighthouse_health/get_facility.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_immunizations.yml b/spec/support/vcr_cassettes/mobile/lighthouse_health/get_immunizations.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_immunizations.yml rename to spec/support/vcr_cassettes/mobile/lighthouse_health/get_immunizations.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_immunizations_blank_group_name.yml b/spec/support/vcr_cassettes/mobile/lighthouse_health/get_immunizations_blank_group_name.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_immunizations_blank_group_name.yml rename to spec/support/vcr_cassettes/mobile/lighthouse_health/get_immunizations_blank_group_name.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_immunizations_blank_note.yml b/spec/support/vcr_cassettes/mobile/lighthouse_health/get_immunizations_blank_note.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_immunizations_blank_note.yml rename to spec/support/vcr_cassettes/mobile/lighthouse_health/get_immunizations_blank_note.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_immunizations_cached_token.yml b/spec/support/vcr_cassettes/mobile/lighthouse_health/get_immunizations_cached_token.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_immunizations_cached_token.yml rename to spec/support/vcr_cassettes/mobile/lighthouse_health/get_immunizations_cached_token.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_immunizations_cvx_code_missing.yml b/spec/support/vcr_cassettes/mobile/lighthouse_health/get_immunizations_cvx_code_missing.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_immunizations_cvx_code_missing.yml rename to spec/support/vcr_cassettes/mobile/lighthouse_health/get_immunizations_cvx_code_missing.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_immunizations_date_missing.yml b/spec/support/vcr_cassettes/mobile/lighthouse_health/get_immunizations_date_missing.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_immunizations_date_missing.yml rename to spec/support/vcr_cassettes/mobile/lighthouse_health/get_immunizations_date_missing.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_immunizations_no_entry.yml b/spec/support/vcr_cassettes/mobile/lighthouse_health/get_immunizations_no_entry.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_immunizations_no_entry.yml rename to spec/support/vcr_cassettes/mobile/lighthouse_health/get_immunizations_no_entry.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_lh_location.yml b/spec/support/vcr_cassettes/mobile/lighthouse_health/get_lh_location.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_lh_location.yml rename to spec/support/vcr_cassettes/mobile/lighthouse_health/get_lh_location.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_lh_location_404.yml b/spec/support/vcr_cassettes/mobile/lighthouse_health/get_lh_location_404.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_lh_location_404.yml rename to spec/support/vcr_cassettes/mobile/lighthouse_health/get_lh_location_404.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_lh_location_no_identifier.yml b/spec/support/vcr_cassettes/mobile/lighthouse_health/get_lh_location_no_identifier.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/lighthouse_health/get_lh_location_no_identifier.yml rename to spec/support/vcr_cassettes/mobile/lighthouse_health/get_lh_location_no_identifier.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/payment_history/retrieve_payment_summary_with_bdn.yml b/spec/support/vcr_cassettes/mobile/payment_history/retrieve_payment_summary_with_bdn.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/payment_history/retrieve_payment_summary_with_bdn.yml rename to spec/support/vcr_cassettes/mobile/payment_history/retrieve_payment_summary_with_bdn.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/payment_history/retrieve_payment_summary_with_bdn_blank_date.yml b/spec/support/vcr_cassettes/mobile/payment_history/retrieve_payment_summary_with_bdn_blank_date.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/payment_history/retrieve_payment_summary_with_bdn_blank_date.yml rename to spec/support/vcr_cassettes/mobile/payment_history/retrieve_payment_summary_with_bdn_blank_date.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/payment_history/retrieve_payment_summary_with_bdn_only_blank_dates.yml b/spec/support/vcr_cassettes/mobile/payment_history/retrieve_payment_summary_with_bdn_only_blank_dates.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/payment_history/retrieve_payment_summary_with_bdn_only_blank_dates.yml rename to spec/support/vcr_cassettes/mobile/payment_history/retrieve_payment_summary_with_bdn_only_blank_dates.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/payment_information/payment_information.yml b/spec/support/vcr_cassettes/mobile/payment_information/payment_information.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/payment_information/payment_information.yml rename to spec/support/vcr_cassettes/mobile/payment_information/payment_information.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/payment_information/payment_information_unauthorized_to_update.yml b/spec/support/vcr_cassettes/mobile/payment_information/payment_information_unauthorized_to_update.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/payment_information/payment_information_unauthorized_to_update.yml rename to spec/support/vcr_cassettes/mobile/payment_information/payment_information_unauthorized_to_update.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/payment_information/service_error_500.yml b/spec/support/vcr_cassettes/mobile/payment_information/service_error_500.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/payment_information/service_error_500.yml rename to spec/support/vcr_cassettes/mobile/payment_information/service_error_500.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/payment_information/service_error_502.yml b/spec/support/vcr_cassettes/mobile/payment_information/service_error_502.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/payment_information/service_error_502.yml rename to spec/support/vcr_cassettes/mobile/payment_information/service_error_502.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/delete_email_initial.yml b/spec/support/vcr_cassettes/mobile/profile/delete_email_initial.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/delete_email_initial.yml rename to spec/support/vcr_cassettes/mobile/profile/delete_email_initial.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/delete_phone_initial.yml b/spec/support/vcr_cassettes/mobile/profile/delete_phone_initial.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/delete_phone_initial.yml rename to spec/support/vcr_cassettes/mobile/profile/delete_phone_initial.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/get_address_status_complete.yml b/spec/support/vcr_cassettes/mobile/profile/get_address_status_complete.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/get_address_status_complete.yml rename to spec/support/vcr_cassettes/mobile/profile/get_address_status_complete.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/get_address_status_error.yml b/spec/support/vcr_cassettes/mobile/profile/get_address_status_error.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/get_address_status_error.yml rename to spec/support/vcr_cassettes/mobile/profile/get_address_status_error.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/get_address_status_incomplete.yml b/spec/support/vcr_cassettes/mobile/profile/get_address_status_incomplete.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/get_address_status_incomplete.yml rename to spec/support/vcr_cassettes/mobile/profile/get_address_status_incomplete.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/get_address_status_incomplete_2.yml b/spec/support/vcr_cassettes/mobile/profile/get_address_status_incomplete_2.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/get_address_status_incomplete_2.yml rename to spec/support/vcr_cassettes/mobile/profile/get_address_status_incomplete_2.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/get_address_transaction_status.yml b/spec/support/vcr_cassettes/mobile/profile/get_address_transaction_status.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/get_address_transaction_status.yml rename to spec/support/vcr_cassettes/mobile/profile/get_address_transaction_status.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/get_email_status_complete.yml b/spec/support/vcr_cassettes/mobile/profile/get_email_status_complete.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/get_email_status_complete.yml rename to spec/support/vcr_cassettes/mobile/profile/get_email_status_complete.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/get_email_status_incomplete.yml b/spec/support/vcr_cassettes/mobile/profile/get_email_status_incomplete.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/get_email_status_incomplete.yml rename to spec/support/vcr_cassettes/mobile/profile/get_email_status_incomplete.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/get_phone_status_complete.yml b/spec/support/vcr_cassettes/mobile/profile/get_phone_status_complete.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/get_phone_status_complete.yml rename to spec/support/vcr_cassettes/mobile/profile/get_phone_status_complete.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/get_phone_status_incomplete.yml b/spec/support/vcr_cassettes/mobile/profile/get_phone_status_incomplete.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/get_phone_status_incomplete.yml rename to spec/support/vcr_cassettes/mobile/profile/get_phone_status_incomplete.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/init_vet360_id_status_400.yml b/spec/support/vcr_cassettes/mobile/profile/init_vet360_id_status_400.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/init_vet360_id_status_400.yml rename to spec/support/vcr_cassettes/mobile/profile/init_vet360_id_status_400.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/init_vet360_id_status_complete.yml b/spec/support/vcr_cassettes/mobile/profile/init_vet360_id_status_complete.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/init_vet360_id_status_complete.yml rename to spec/support/vcr_cassettes/mobile/profile/init_vet360_id_status_complete.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/init_vet360_id_status_incomplete.yml b/spec/support/vcr_cassettes/mobile/profile/init_vet360_id_status_incomplete.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/init_vet360_id_status_incomplete.yml rename to spec/support/vcr_cassettes/mobile/profile/init_vet360_id_status_incomplete.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/init_vet360_id_success.yml b/spec/support/vcr_cassettes/mobile/profile/init_vet360_id_success.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/init_vet360_id_success.yml rename to spec/support/vcr_cassettes/mobile/profile/init_vet360_id_success.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/post_address_initial.yml b/spec/support/vcr_cassettes/mobile/profile/post_address_initial.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/post_address_initial.yml rename to spec/support/vcr_cassettes/mobile/profile/post_address_initial.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/post_email_initial.yml b/spec/support/vcr_cassettes/mobile/profile/post_email_initial.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/post_email_initial.yml rename to spec/support/vcr_cassettes/mobile/profile/post_email_initial.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/post_phone_initial.yml b/spec/support/vcr_cassettes/mobile/profile/post_phone_initial.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/post_phone_initial.yml rename to spec/support/vcr_cassettes/mobile/profile/post_phone_initial.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/put_address_initial.yml b/spec/support/vcr_cassettes/mobile/profile/put_address_initial.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/put_address_initial.yml rename to spec/support/vcr_cassettes/mobile/profile/put_address_initial.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/put_address_success.yml b/spec/support/vcr_cassettes/mobile/profile/put_address_success.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/put_address_success.yml rename to spec/support/vcr_cassettes/mobile/profile/put_address_success.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/put_email_initial.yml b/spec/support/vcr_cassettes/mobile/profile/put_email_initial.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/put_email_initial.yml rename to spec/support/vcr_cassettes/mobile/profile/put_email_initial.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/put_phone_initial.yml b/spec/support/vcr_cassettes/mobile/profile/put_phone_initial.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/put_phone_initial.yml rename to spec/support/vcr_cassettes/mobile/profile/put_phone_initial.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/rated_disabilities.yml b/spec/support/vcr_cassettes/mobile/profile/rated_disabilities.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/rated_disabilities.yml rename to spec/support/vcr_cassettes/mobile/profile/rated_disabilities.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/rated_disabilities_400.yml b/spec/support/vcr_cassettes/mobile/profile/rated_disabilities_400.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/rated_disabilities_400.yml rename to spec/support/vcr_cassettes/mobile/profile/rated_disabilities_400.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/rated_disabilities_401.yml b/spec/support/vcr_cassettes/mobile/profile/rated_disabilities_401.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/rated_disabilities_401.yml rename to spec/support/vcr_cassettes/mobile/profile/rated_disabilities_401.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/rated_disabilities_403.yml b/spec/support/vcr_cassettes/mobile/profile/rated_disabilities_403.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/rated_disabilities_403.yml rename to spec/support/vcr_cassettes/mobile/profile/rated_disabilities_403.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/rated_disabilities_500.yml b/spec/support/vcr_cassettes/mobile/profile/rated_disabilities_500.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/rated_disabilities_500.yml rename to spec/support/vcr_cassettes/mobile/profile/rated_disabilities_500.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/rated_disabilities_mixed_service_connected.yml b/spec/support/vcr_cassettes/mobile/profile/rated_disabilities_mixed_service_connected.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/rated_disabilities_mixed_service_connected.yml rename to spec/support/vcr_cassettes/mobile/profile/rated_disabilities_mixed_service_connected.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/rating_info.yml b/spec/support/vcr_cassettes/mobile/profile/rating_info.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/rating_info.yml rename to spec/support/vcr_cassettes/mobile/profile/rating_info.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/rating_info_400.yml b/spec/support/vcr_cassettes/mobile/profile/rating_info_400.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/rating_info_400.yml rename to spec/support/vcr_cassettes/mobile/profile/rating_info_400.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/rating_info_403.yml b/spec/support/vcr_cassettes/mobile/profile/rating_info_403.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/rating_info_403.yml rename to spec/support/vcr_cassettes/mobile/profile/rating_info_403.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/profile/rating_info_500.yml b/spec/support/vcr_cassettes/mobile/profile/rating_info_500.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/profile/rating_info_500.yml rename to spec/support/vcr_cassettes/mobile/profile/rating_info_500.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/providers/get_provider_200.yml b/spec/support/vcr_cassettes/mobile/providers/get_provider_200.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/providers/get_provider_200.yml rename to spec/support/vcr_cassettes/mobile/providers/get_provider_200.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/providers/get_provider_400.yml b/spec/support/vcr_cassettes/mobile/providers/get_provider_400.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/providers/get_provider_400.yml rename to spec/support/vcr_cassettes/mobile/providers/get_provider_400.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/providers/get_provider_500.yml b/spec/support/vcr_cassettes/mobile/providers/get_provider_500.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/providers/get_provider_500.yml rename to spec/support/vcr_cassettes/mobile/providers/get_provider_500.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/rx_refill/prescriptions/gets_a_list_of_all_prescriptions.yml b/spec/support/vcr_cassettes/mobile/rx_refill/prescriptions/gets_a_list_of_all_prescriptions.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/rx_refill/prescriptions/gets_a_list_of_all_prescriptions.yml rename to spec/support/vcr_cassettes/mobile/rx_refill/prescriptions/gets_a_list_of_all_prescriptions.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/rx_refill/prescriptions/gets_optimistic_locking_error.yml b/spec/support/vcr_cassettes/mobile/rx_refill/prescriptions/gets_optimistic_locking_error.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/rx_refill/prescriptions/gets_optimistic_locking_error.yml rename to spec/support/vcr_cassettes/mobile/rx_refill/prescriptions/gets_optimistic_locking_error.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/rx_refill/prescriptions/gets_tracking_for_a_prescription.yml b/spec/support/vcr_cassettes/mobile/rx_refill/prescriptions/gets_tracking_for_a_prescription.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/rx_refill/prescriptions/gets_tracking_for_a_prescription.yml rename to spec/support/vcr_cassettes/mobile/rx_refill/prescriptions/gets_tracking_for_a_prescription.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/rx_refill/prescriptions/gets_tracking_with_empty_other_prescriptions.yml b/spec/support/vcr_cassettes/mobile/rx_refill/prescriptions/gets_tracking_with_empty_other_prescriptions.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/rx_refill/prescriptions/gets_tracking_with_empty_other_prescriptions.yml rename to spec/support/vcr_cassettes/mobile/rx_refill/prescriptions/gets_tracking_with_empty_other_prescriptions.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/rx_refill/prescriptions/handles_failed_stations.yml b/spec/support/vcr_cassettes/mobile/rx_refill/prescriptions/handles_failed_stations.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/rx_refill/prescriptions/handles_failed_stations.yml rename to spec/support/vcr_cassettes/mobile/rx_refill/prescriptions/handles_failed_stations.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/rx_refill/prescriptions/prescription_refill_error.yml b/spec/support/vcr_cassettes/mobile/rx_refill/prescriptions/prescription_refill_error.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/rx_refill/prescriptions/prescription_refill_error.yml rename to spec/support/vcr_cassettes/mobile/rx_refill/prescriptions/prescription_refill_error.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/rx_refill/prescriptions/refills_prescriptions.yml b/spec/support/vcr_cassettes/mobile/rx_refill/prescriptions/refills_prescriptions.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/rx_refill/prescriptions/refills_prescriptions.yml rename to spec/support/vcr_cassettes/mobile/rx_refill/prescriptions/refills_prescriptions.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/rx_refill/prescriptions/refills_prescriptions_not_found.yml b/spec/support/vcr_cassettes/mobile/rx_refill/prescriptions/refills_prescriptions_not_found.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/rx_refill/prescriptions/refills_prescriptions_not_found.yml rename to spec/support/vcr_cassettes/mobile/rx_refill/prescriptions/refills_prescriptions_not_found.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/rx_refill/prescriptions/refills_prescriptions_with_error.yml b/spec/support/vcr_cassettes/mobile/rx_refill/prescriptions/refills_prescriptions_with_error.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/rx_refill/prescriptions/refills_prescriptions_with_error.yml rename to spec/support/vcr_cassettes/mobile/rx_refill/prescriptions/refills_prescriptions_with_error.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/rx_refill/prescriptions/refills_prescriptions_with_multiple_errors.yml b/spec/support/vcr_cassettes/mobile/rx_refill/prescriptions/refills_prescriptions_with_multiple_errors.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/rx_refill/prescriptions/refills_prescriptions_with_multiple_errors.yml rename to spec/support/vcr_cassettes/mobile/rx_refill/prescriptions/refills_prescriptions_with_multiple_errors.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/rx_refill/prescriptions/tracking_error_id.yml b/spec/support/vcr_cassettes/mobile/rx_refill/prescriptions/tracking_error_id.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/rx_refill/prescriptions/tracking_error_id.yml rename to spec/support/vcr_cassettes/mobile/rx_refill/prescriptions/tracking_error_id.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/user/get_facilities.yml b/spec/support/vcr_cassettes/mobile/user/get_facilities.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/user/get_facilities.yml rename to spec/support/vcr_cassettes/mobile/user/get_facilities.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/user/get_facilities_empty.yml b/spec/support/vcr_cassettes/mobile/user/get_facilities_empty.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/user/get_facilities_empty.yml rename to spec/support/vcr_cassettes/mobile/user/get_facilities_empty.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/user/get_facilities_no_ids.yml b/spec/support/vcr_cassettes/mobile/user/get_facilities_no_ids.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/user/get_facilities_no_ids.yml rename to spec/support/vcr_cassettes/mobile/user/get_facilities_no_ids.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/va_eligibility/get_scheduling_configurations_200.yml b/spec/support/vcr_cassettes/mobile/va_eligibility/get_scheduling_configurations_200.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/va_eligibility/get_scheduling_configurations_200.yml rename to spec/support/vcr_cassettes/mobile/va_eligibility/get_scheduling_configurations_200.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/va_eligibility/get_scheduling_configurations_200_all_enabled.yml b/spec/support/vcr_cassettes/mobile/va_eligibility/get_scheduling_configurations_200_all_enabled.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/va_eligibility/get_scheduling_configurations_200_all_enabled.yml rename to spec/support/vcr_cassettes/mobile/va_eligibility/get_scheduling_configurations_200_all_enabled.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/va_eligibility/get_scheduling_configurations_200_bad_facility.yml b/spec/support/vcr_cassettes/mobile/va_eligibility/get_scheduling_configurations_200_bad_facility.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/va_eligibility/get_scheduling_configurations_200_bad_facility.yml rename to spec/support/vcr_cassettes/mobile/va_eligibility/get_scheduling_configurations_200_bad_facility.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/va_profile/demographics/demographics.yml b/spec/support/vcr_cassettes/mobile/va_profile/demographics/demographics.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/va_profile/demographics/demographics.yml rename to spec/support/vcr_cassettes/mobile/va_profile/demographics/demographics.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/va_profile/demographics/logingov.yml b/spec/support/vcr_cassettes/mobile/va_profile/demographics/logingov.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/va_profile/demographics/logingov.yml rename to spec/support/vcr_cassettes/mobile/va_profile/demographics/logingov.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/va_profile/post_read_service_histories_200.yml b/spec/support/vcr_cassettes/mobile/va_profile/post_read_service_histories_200.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/va_profile/post_read_service_histories_200.yml rename to spec/support/vcr_cassettes/mobile/va_profile/post_read_service_histories_200.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/va_profile/post_read_service_histories_200_no_end_date.yml b/spec/support/vcr_cassettes/mobile/va_profile/post_read_service_histories_200_no_end_date.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/va_profile/post_read_service_histories_200_no_end_date.yml rename to spec/support/vcr_cassettes/mobile/va_profile/post_read_service_histories_200_no_end_date.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/va_profile/post_read_service_history_200.yml b/spec/support/vcr_cassettes/mobile/va_profile/post_read_service_history_200.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/va_profile/post_read_service_history_200.yml rename to spec/support/vcr_cassettes/mobile/va_profile/post_read_service_history_200.yml diff --git a/modules/mobile/spec/support/vcr_cassettes/va_profile/post_read_service_history_200_empty.yml b/spec/support/vcr_cassettes/mobile/va_profile/post_read_service_history_200_empty.yml similarity index 100% rename from modules/mobile/spec/support/vcr_cassettes/va_profile/post_read_service_history_200_empty.yml rename to spec/support/vcr_cassettes/mobile/va_profile/post_read_service_history_200_empty.yml