-
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.
API-45023-recache-mpi-after-icn (#20798)
* API-45023-recache-mpi-after-icn * WIP * re caches MPI data once we have the ICN * adds method to enable re fetching the cache on MPI data Changes to be committed: modified: modules/claims_api/app/controllers/claims_api/v1/application_controller.rb modified: modules/claims_api/app/models/claims_api/veteran.rb * Rubocop fix * API-45023-recache-mpi-after-icn * Adds call to recache MPI data when building from headers after we have the ICN * Adds test that new method is called * Clean up Cleans up a comment line from another file that was not necessary modified: modules/claims_api/app/controllers/claims_api/v1/application_controller.rb new file: modules/claims_api/spec/controllers/v1/application_controller_spec.rb modified: modules/claims_api/spec/controllers/v1/disability_compensation_controller_spec.rb * API-45023-recache-mpi-after-icn * Adds flipper for `add_person_proxy` update * Adjusts related tests modified: config/features.yml modified: modules/claims_api/app/controllers/claims_api/v1/application_controller.rb modified: modules/claims_api/spec/controllers/v1/application_controller_spec.rb modified: modules/claims_api/spec/requests/v1/forms/2122_spec.rb modified: modules/claims_api/spec/requests/v1/forms/526_spec.rb
- Loading branch information
1 parent
65cf4b0
commit b0f0159
Showing
7 changed files
with
58 additions
and
2 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
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
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
42 changes: 42 additions & 0 deletions
42
modules/claims_api/spec/controllers/v1/application_controller_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,42 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
# require 'mock_redis' | ||
|
||
RSpec.describe ClaimsApi::V1::ApplicationController, type: :controller do | ||
let(:controller) { described_class.new } | ||
let(:with_gender) { false } | ||
|
||
before do | ||
allow(Flipper).to receive(:enabled?).with(:lighthouse_claims_api_add_person_proxy).and_return(true) | ||
|
||
allow(controller).to receive(:header).with('X-VA-SSN').and_return('123456789') | ||
allow(controller).to receive(:header).with('X-VA-First-Name').and_return('Jake') | ||
allow(controller).to receive(:header).with('X-VA-Last-Name').and_return('Doe') | ||
allow(controller).to receive(:header).with('X-VA-Birth-Date').and_return('1967-05-06') | ||
|
||
controller.instance_variable_set(:@is_valid_ccg_flow, true) | ||
@veteran_instance = double('Veteran') | ||
allow(ClaimsApi::Veteran).to receive(:new).and_return(@veteran_instance) | ||
|
||
allow(@veteran_instance).to receive(:mpi_record?).and_return(true) | ||
allow(@veteran_instance).to receive(:edipi=) | ||
allow(@veteran_instance).to receive(:edipi_mpi) | ||
allow(@veteran_instance).to receive(:edipi) | ||
allow(@veteran_instance).to receive(:participant_id_mpi) | ||
allow(@veteran_instance).to receive(:participant_id=) | ||
allow(@veteran_instance).to receive(:participant_id) | ||
allow(@veteran_instance).to receive(:mpi_icn) | ||
allow(@veteran_instance).to receive(:icn=) | ||
allow(@veteran_instance).to receive(:icn) | ||
end | ||
|
||
describe '#veteran_from_headers' do | ||
it 'calls the recache method when building from headers' do | ||
allow(@veteran_instance).to receive(:recache_mpi_data) | ||
controller.send(:veteran_from_headers, with_gender: with_gender) | ||
|
||
expect(@veteran_instance).to have_received(:recache_mpi_data) | ||
end | ||
end | ||
end |
2 changes: 0 additions & 2 deletions
2
modules/claims_api/spec/controllers/v1/disability_compensation_controller_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
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
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