Skip to content

Commit

Permalink
Add flag to enable direct deposit for education benefits (#15804)
Browse files Browse the repository at this point in the history
* Add is_edu_claim_available flag which will be used to enable direct deposit for edu benefits

* Added a spec to test for missing education benefits flag
  • Loading branch information
tpharrison authored Mar 6, 2024
1 parent c94a4fa commit b6e96b4
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 4 deletions.
4 changes: 3 additions & 1 deletion app/swagger/swagger/requests/profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ class Profile
has_no_fiduciary_assigned
is_not_deceased
has_payment_address
is_edu_claim_available
]
property :can_update_direct_deposit, type: :boolean, example: true, description: 'Must be true to view payment account information'
property :can_update_direct_deposit, type: :boolean, example: true, description: 'Must be true to view C&P direct deposit information'
property :is_corp_available, type: :boolean, example: true, description: ''
property :is_corp_rec_found, type: :boolean, example: true, description: ''
property :has_no_bdn_payments, type: :boolean, example: true, description: ''
Expand All @@ -54,6 +55,7 @@ class Profile
property :has_no_fiduciary_assigne, type: :boolean, example: true, description: ''
property :is_not_decease, type: :boolean, example: true, description: ''
property :has_payment_address, type: :boolean, example: true, description: ''
property :is_edu_claim_available, type: :boolean, example: true, description: 'Must be true to view EDU direct deposit information'
end

property :payment_account do
Expand Down
3 changes: 2 additions & 1 deletion lib/lighthouse/direct_deposit/control_information.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class ControlInformation
:has_mailing_address,
:has_no_fiduciary_assigned,
:is_not_deceased,
:has_payment_address
:has_payment_address,
:is_edu_claim_available
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
control_info = json['data']['attributes']['control_information']

expect(control_info['can_update_direct_deposit']).to be(true)
expect(control_info['is_edu_claim_available']).to be(true)
end

it 'does not return errors' do
Expand All @@ -56,6 +57,20 @@
end
end

context 'when missing education benefits flag' do
it 'returns a status of 200' do
VCR.use_cassette('lighthouse/direct_deposit/show/200_missing_edu_flag') do
get(:show)
end

expect(response).to have_http_status(:ok)

json = JSON.parse(response.body)
control_info = json['data']['attributes']['control_information']
expect(control_info['is_edu_claim_available']).to be_nil
end
end

context 'when has restrictions' do
it 'control info has flags set to false' do
VCR.use_cassette('lighthouse/direct_deposit/show/200_has_restrictions') do
Expand All @@ -65,6 +80,7 @@
json = JSON.parse(response.body)['data']['attributes']
expect(json['control_information']['can_update_direct_deposit']).to be(false)
expect(json['control_information']['has_payment_address']).to be(false)
expect(json['control_information']['is_edu_claim_available']).to be(false)
end
end

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b6e96b4

Please sign in to comment.