Skip to content

Commit

Permalink
Api 27055 null vet icn v2 526 (#12895)
Browse files Browse the repository at this point in the history
* Add before_action for CCG

* Add nil-safing to mpi_record

* Add rspec test

* Remove byebug
  • Loading branch information
mchristiansonVA authored Jun 7, 2023
1 parent 3fe7b94 commit 1a3f708
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/claims_api/app/models/claims_api/veteran.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def mpi
end

def mpi_record?(user_key: uuid)
mpi.mvi_response(user_key:).ok?
mpi&.mvi_response(user_key:)&.ok?
end

def ssn=(new_ssn)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3051,6 +3051,23 @@
end
end
end

describe 'Service returns resource not found' do
context 'when no ICN value is supplied' do
let(:veteran_id) { nil }

it 'responds with bad request' do
with_okta_user(scopes) do |auth_header|
VCR.use_cassette('evss/claims/claims') do
json = JSON.parse(data)
data = json
post submit_path, params: data, headers: auth_header
expect(response).to have_http_status(:not_found)
end
end
end
end
end
end

context 'validate' do
Expand Down

0 comments on commit 1a3f708

Please sign in to comment.