-
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.
- Loading branch information
Showing
2 changed files
with
92 additions
and
14 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 'includes contact' do | ||
expect(subject.contacts).to be_empty | ||
end | ||
end | ||
end |