From 81ee32affa3a2b068ae5d41357b813d91f258c7b Mon Sep 17 00:00:00 2001 From: Seth Darr <92405130+sethdarragile6@users.noreply.github.com> Date: Mon, 25 Mar 2024 12:40:19 -0700 Subject: [PATCH] added BRD intake-sites test (#16071) * added BRD intake-sites test * test fix --- ...benefits_reference_data_controller_spec.rb | 2 +- spec/requests/swagger_spec.rb | 17 +++++- ...onse.yml => 200_disabilities_response.yml} | 0 .../200_intake_sites_response.yml | 61 +++++++++++++++++++ 4 files changed, 76 insertions(+), 4 deletions(-) rename spec/support/vcr_cassettes/lighthouse/benefits_reference_data/{200_response.yml => 200_disabilities_response.yml} (100%) create mode 100644 spec/support/vcr_cassettes/lighthouse/benefits_reference_data/200_intake_sites_response.yml diff --git a/spec/controllers/v0/benefits_reference_data_controller_spec.rb b/spec/controllers/v0/benefits_reference_data_controller_spec.rb index 6c741a2a53b..3a92d525c9d 100644 --- a/spec/controllers/v0/benefits_reference_data_controller_spec.rb +++ b/spec/controllers/v0/benefits_reference_data_controller_spec.rb @@ -11,7 +11,7 @@ describe '#get_data' do it 'gets data from lighthouse when valid path end-point is provided' do - VCR.use_cassette('lighthouse/benefits_reference_data/200_response') do + VCR.use_cassette('lighthouse/benefits_reference_data/200_disabilities_response') do get(:get_data, params: { path: 'disabilities' }) end expect(response.status).to eq(200) diff --git a/spec/requests/swagger_spec.rb b/spec/requests/swagger_spec.rb index 50bcd575c24..f41bd29a8c0 100644 --- a/spec/requests/swagger_spec.rb +++ b/spec/requests/swagger_spec.rb @@ -968,6 +968,7 @@ # TODO: remove Flipper feature toggle when lighthouse provider is implemented Flipper.disable('disability_compensation_lighthouse_rated_disabilities_provider_foreground') Flipper.disable('disability_compensation_prevent_submission_job') + Flipper.disable(ApiProviderFactory::FEATURE_TOGGLE_BRD) end let(:form526v2) do @@ -1029,7 +1030,6 @@ end it 'supports getting separation_locations' do - Flipper.disable(ApiProviderFactory::FEATURE_TOGGLE_BRD) expect(subject).to validate(:get, '/v0/disability_compensation_form/separation_locations', 401) VCR.use_cassette('evss/reference_data/get_intake_sites_500') do expect(subject).to validate(:get, '/v0/disability_compensation_form/separation_locations', 502, headers) @@ -1881,8 +1881,8 @@ end describe 'Lighthouse Benefits Reference Data' do - it 'gets data from endpoint' do - VCR.use_cassette('lighthouse/benefits_reference_data/200_response') do + it 'gets disabilities data from endpoint' do + VCR.use_cassette('lighthouse/benefits_reference_data/200_disabilities_response') do expect(subject).to validate( :get, '/v0/benefits_reference_data/{path}', @@ -1891,6 +1891,17 @@ ) end end + + it 'gets intake-sites data from endpoint' do + VCR.use_cassette('lighthouse/benefits_reference_data/200_intake_sites_response') do + expect(subject).to validate( + :get, + '/v0/benefits_reference_data/{path}', + 200, + headers.merge('path' => 'intake-sites') + ) + end + end end describe 'appeals' do diff --git a/spec/support/vcr_cassettes/lighthouse/benefits_reference_data/200_response.yml b/spec/support/vcr_cassettes/lighthouse/benefits_reference_data/200_disabilities_response.yml similarity index 100% rename from spec/support/vcr_cassettes/lighthouse/benefits_reference_data/200_response.yml rename to spec/support/vcr_cassettes/lighthouse/benefits_reference_data/200_disabilities_response.yml diff --git a/spec/support/vcr_cassettes/lighthouse/benefits_reference_data/200_intake_sites_response.yml b/spec/support/vcr_cassettes/lighthouse/benefits_reference_data/200_intake_sites_response.yml new file mode 100644 index 00000000000..5e9d708f916 --- /dev/null +++ b/spec/support/vcr_cassettes/lighthouse/benefits_reference_data/200_intake_sites_response.yml @@ -0,0 +1,61 @@ +--- +http_interactions: +- request: + method: get + uri: https://sandbox-api.va.gov/services/benefits-reference-data/v1/intake-sites + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Vets.gov Agent + Apikey: + - bad_key + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + headers: + Date: + - Tue, 14 Apr 2020 17:55:43 GMT + Content-Type: + - application/json; charset=utf-8 + Content-Length: + - '48' + Connection: + - keep-alive + Access-Control-Allow-Origin: + - "*" + Cache-Control: + - '' + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + Set-Cookie: + - TS016f4012=01c8917e486328adc21ae638f4215bf74f2d91e2de452bfb4cc024f6f0f1a653d6e4f22d0b79aac369ae5e21f710b6bfdcc05f8d81; + Max-Age=900; Path=/ + body: + encoding: UTF-8 + string: '{ + "totalItems": 0, + "totalPages": 0, + "links": [ + { + "href": "https://sandbox-api.va.gov/services/benefits-reference-data/v1/intake-sites", + "rel": "self" + } + ], + "items": [ + { + "id": 5674661, + "description": "AF Academy" + } + ] +}' + http_version: null + recorded_at: Mon, 25 Mar 2024 17:55:43 GMT +recorded_with: hand-made file, not recorded \ No newline at end of file