Skip to content

Commit

Permalink
remove prefill settings
Browse files Browse the repository at this point in the history
  • Loading branch information
RachalCassity committed Apr 22, 2024
1 parent 4f1015c commit 25f200a
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions spec/models/form_profile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1077,10 +1077,6 @@ def self.test_pciu_us_phone(primary, expected)
end

describe '#prefill_form' do
def can_prefill_vaprofile(yes)
expect(user).to receive(:authorize).at_least(:once).with(:va_profile, :access?).and_return(yes)
end

def strip_required(schema)
new_schema = {}

Expand Down Expand Up @@ -1349,7 +1345,6 @@ def expect_prefilled(form_id)
it 'returns default values' do
VCR.use_cassette('va_profile/military_personnel/post_read_service_history_404',
allow_playback_repeats: true, match_requests_on: %i[method body]) do
can_prefill_vaprofile(true)
output = form_profile.send(:initialize_military_information).attributes.transform_keys(&:to_s)
expect(output['currently_active_duty']).to eq(false)
expect(output['currently_active_duty_hash']).to eq({ yes: false })
Expand Down Expand Up @@ -1400,7 +1395,6 @@ def expect_prefilled(form_id)
context 'with military information data', skip_va_profile: true do
context 'with va profile prefill on' do
before do
VAProfile::Configuration::SETTINGS.prefill = true

v22_1990_expected['email'] = VAProfileRedis::ContactInformation.for_user(user).email.email_address
v22_1990_expected['homePhone'] = '3035551234'
Expand All @@ -1414,10 +1408,6 @@ def expect_prefilled(form_id)
}
end

after do
VAProfile::Configuration::SETTINGS.prefill = false
end

it 'prefills 1990' do
VCR.use_cassette('va_profile/military_personnel/service_history_200_many_episodes',
allow_playback_repeats: true, match_requests_on: %i[uri method body]) do
Expand All @@ -1443,7 +1433,6 @@ def expect_prefilled(form_id)

context 'with VA Profile and ppiu prefill for 0994' do
before do
can_prefill_vaprofile(true)
expect(user).to receive(:authorize).with(:ppiu, :access?).and_return(true).at_least(:once)
expect(user).to receive(:authorize).with(:evss, :access?).and_return(true).at_least(:once)
v22_0994_expected['bankAccount'] = {
Expand Down Expand Up @@ -1479,7 +1468,6 @@ def expect_prefilled(form_id)

context 'with VA Profile prefill for 10203' do
before do
can_prefill_vaprofile(true)
expect(user).to receive(:authorize).with(:evss, :access?).and_return(true).at_least(:once)
end

Expand All @@ -1493,7 +1481,6 @@ def expect_prefilled(form_id)

context 'with VA Profile and GiBillStatus prefill for 10203' do
before do
can_prefill_vaprofile(true)
expect(user).to receive(:authorize).with(:evss, :access?).and_return(true).at_least(:once)
v22_10203_expected['remainingEntitlement'] = {
'months' => 0,
Expand Down Expand Up @@ -1522,12 +1509,10 @@ def expect_prefilled(form_id)
end
end
end

end

context 'with a user that can prefill VA Profile' do
before do
can_prefill_vaprofile(true)
end

context 'with a user with no vet360_id' do
before do
Expand Down Expand Up @@ -1603,17 +1588,12 @@ def expect_prefilled(form_id)
context 'without ppiu' do
context 'when Vet360 prefill is enabled' do
before do
VAProfile::Configuration::SETTINGS.prefill = true # TODO: - is this missing in the failures above?
expected_veteran_info = v21_526_ez_expected['veteran']
expected_veteran_info['emailAddress'] =
VAProfileRedis::ContactInformation.for_user(user).email.email_address
expected_veteran_info['primaryPhone'] = '3035551234'
end

after do
VAProfile::Configuration::SETTINGS.prefill = false
end

it 'returns prefilled 21-526EZ' do
Flipper.disable(ApiProviderFactory::FEATURE_TOGGLE_RATED_DISABILITIES_FOREGROUND)
expect(user).to receive(:authorize).with(:ppiu, :access?).and_return(true).at_least(:once)
Expand Down

0 comments on commit 25f200a

Please sign in to comment.