-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Find End Product without End Product Establishment for RAMP (#10363)
connects #9964 If the EndProductEstablishment for a RAMP intake isn't saved, find the matching end product when needed
- Loading branch information
Showing
8 changed files
with
151 additions
and
32 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# frozen_string_literal: true | ||
|
||
describe RampReview do | ||
let(:ramp_election) { create(:ramp_election, option_selected: "higher_level_review", established_at: Time.zone.now) } | ||
let(:claim_date) { ramp_election.receipt_date.to_date.mdY } | ||
let(:reference_id) { nil } | ||
let(:end_product_status) { nil } | ||
let(:last_action_date) { nil } | ||
|
||
let(:modifier) { "682" } | ||
let(:claim_type_code) { "682HLRRRAMP" } | ||
|
||
let!(:end_product) do | ||
Generators::EndProduct.build( | ||
veteran_file_number: ramp_election.veteran_file_number, | ||
bgs_attrs: { | ||
claim_type_code: claim_type_code, | ||
end_product_type_code: modifier, | ||
claim_receive_date: claim_date, | ||
status_type_code: end_product_status, | ||
last_action_date: last_action_date | ||
} | ||
) | ||
end | ||
|
||
context "#end_product_active?" do | ||
subject { ramp_election.end_product_active? } | ||
|
||
context "when the end_product_establishment can sync" do | ||
let(:reference_id) { end_product.claim_id } | ||
let!(:end_product_establishment) do | ||
create( | ||
:end_product_establishment, | ||
source: ramp_election, | ||
reference_id: reference_id, | ||
veteran_file_number: ramp_election.veteran_file_number, | ||
synced_status: end_product_status | ||
) | ||
end | ||
|
||
context "when the end product is inactive" do | ||
let(:end_product_status) { "CLR" } | ||
|
||
it { is_expected.to eq(false) } | ||
end | ||
|
||
context "when the end product is active" do | ||
let(:end_product_status) { "PEND" } | ||
|
||
it { is_expected.to eq(true) } | ||
end | ||
end | ||
|
||
context "when there is no EPE and all preexisting EPs are inactive" do | ||
context "all preexisting end products are inactive" do | ||
let(:end_product_status) { "CLR" } | ||
|
||
it { is_expected.to eq(false) } | ||
end | ||
|
||
context "one preexisting end product is active" do | ||
let(:end_product_status) { "PEND" } | ||
|
||
it { is_expected.to eq(true) } | ||
end | ||
end | ||
end | ||
end |