Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mockdata setup #19946

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen_string_literal: true
# frozen_string_literal: true

require 'feature_flipper'
require 'aes_256_cbc_encryptor'
Expand Down
12 changes: 12 additions & 0 deletions config/betamocks/services_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -883,3 +883,15 @@
- :method: :get
:path: "/demographics/demographics/v1/*/*"
:file_path: "vet360/demographics/default"


# VA Profile Military Personnel
- :name: "VA Profile Military Service History"
:base_uri: <%= "#{URI(Settings.vet360.url).host}:#{URI(Settings.vet360.url).port}" %>
:endpoints:
- :method: :post
:path: "/profile-service/profile/v3/2.16.840.1.113883.3.42.10001.100001.12/*"
:file_path: "va_profile/military_personnel"
:cache_multiple_responses:
:uid_location: "url"
:uid_locator: "\/profile-service/profile/v3/2.16.840.1.113883.3.42.10001.100001.12/(.+)"
15 changes: 8 additions & 7 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ sign_in:
jwt_old_encode_key: 'spec/fixtures/sign_in/privatekey_old.pem'
cookies_secure: false
info_cookie_domain: localhost
auto_uplevel: true
auto_uplevel: false
mock_auth_url: http://localhost:3000/mocked_authentication/profiles
mock_redirect_uri: http://localhost:3000/v0/sign_in/callback
mockdata_sync_api_key: ~
Expand Down Expand Up @@ -241,27 +241,28 @@ bip:

# Settings for VAProfile
vet360:
prefill: true
url: "https://int.vet360.va.gov"
contact_information:
cache_enabled: false
cache_enabled: true
enabled: true
timeout: 30
mock: false
mock: true
demographics:
cache_enabled: false
cache_enabled: true
enabled: true
timeout: 30
mock: true
military_personnel:
cache_enabled: false
cache_enabled: true
enabled: true
timeout: 30
mock: false
mock: true
veteran_status:
cache_enabled: true
enabled: true
timeout: 30
mock: false
mock: true
address_validation:
hostname: "sandbox-api.va.gov"
api_key: "<AV_KEY>"
Expand Down
1 change: 1 addition & 0 deletions db/schema.rb

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

2 changes: 1 addition & 1 deletion lib/sign_in/idme/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def ssl_cert
end

def log_credential
false
true
end

def sign_up_operation
Expand Down
2 changes: 1 addition & 1 deletion lib/sign_in/logingov/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def ssl_cert
end

def log_credential
false
true
end

def service_name
Expand Down
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
Loading