-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bugfix] Personal health care contacts: Selects only valid contact ty…
…pes (#16062) * Selects only valid contact types
- Loading branch information
Showing
4 changed files
with
196 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
spec/lib/va_profile/profile/v3/health_benefit_bio_response_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
require 'va_profile/profile/v3/health_benefit_bio_response' | ||
|
||
describe VAProfile::Profile::V3::HealthBenefitBioResponse do | ||
subject { described_class.new(response) } | ||
|
||
let(:response) do | ||
double('Faraday::Response', | ||
status: 200, | ||
body: { | ||
'profile' => { | ||
'health_benefit' => { | ||
'associated_persons' => [{ | ||
'contact_type' => contact_type | ||
}] | ||
} | ||
} | ||
}) | ||
end | ||
|
||
describe 'Emergency contact' do | ||
let(:contact_type) { 'Emergency Contact' } | ||
|
||
it 'includes contact' do | ||
expect(subject.contacts).not_to be_empty | ||
end | ||
end | ||
|
||
describe 'Other emergency contact' do | ||
let(:contact_type) { 'Other emergency contact' } | ||
|
||
it 'includes contact' do | ||
expect(subject.contacts).not_to be_empty | ||
end | ||
end | ||
|
||
describe 'Primary Next of Kin' do | ||
let(:contact_type) { 'Primary Next of Kin' } | ||
|
||
it 'includes contact' do | ||
expect(subject.contacts).not_to be_empty | ||
end | ||
end | ||
|
||
describe 'Other Next of Kin' do | ||
let(:contact_type) { 'Other Next of Kin' } | ||
|
||
it 'includes contact' do | ||
expect(subject.contacts).not_to be_empty | ||
end | ||
end | ||
|
||
describe 'Invalid contact type' do | ||
let(:contact_type) { 'Invalid type' } | ||
|
||
it 'does not include contact' do | ||
expect(subject.contacts).to be_empty | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
spec/support/vcr_cassettes/va_profile/profile/v3/health_benefit_bio_500.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.