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

Fixed failing rspecs #18978

Merged
merged 1 commit into from
Jul 10, 2023
Merged
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
50 changes: 50 additions & 0 deletions spec/models/end_product_establishment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,46 @@
)
end

let(:veteran_assoc_rating) do
Generators::Veteran.create(
file_number: "43214321"
)
end

let(:epe) do
EndProductEstablishment.new(
source: source,
veteran_file_number: veteran_assoc_rating.file_number,
code: code,
payee_code: payee_code,
claim_date: 2.days.ago,
station: "397",
reference_id: reference_id,
claimant_participant_id: veteran_assoc_rating.participant_id,
synced_status: synced_status,
committed_at: committed_at,
benefit_type_code: benefit_type_code,
doc_reference_id: doc_reference_id,
development_item_reference_id: development_item_reference_id,
established_at: 30.days.ago,
user: current_user,
limited_poa_code: limited_poa_code,
limited_poa_access: limited_poa_access,
last_synced_at: last_synced_at
)
end

context "when ep is one of many associated to the rating" do
subject { epe.associated_rating }

let!(:rating) do
Generators::PromulgatedRating.build(
participant_id: veteran_assoc_rating.participant_id,
promulgation_date: epe.established_at,
associated_claims: associated_claims
)
end

let(:associated_claims) do
[
{ clm_id: "09123", bnft_clm_tc: end_product_establishment.code },
Expand All @@ -1085,6 +1124,16 @@
end

context "when associated rating only has 1 ep" do
subject { epe.associated_rating }

let!(:rating) do
Generators::PromulgatedRating.build(
participant_id: veteran_assoc_rating.participant_id,
promulgation_date: epe.established_at,
associated_claims: associated_claims
)
end

let(:associated_claims) do
[
{ clm_id: end_product_establishment.reference_id, bnft_clm_tc: end_product_establishment.code }
Expand All @@ -1099,6 +1148,7 @@
}

context "when rating is before established_at date" do
subject { end_product_establishment.associated_rating }
let!(:another_rating) do
Generators::PromulgatedRating.build(
profile_date: end_product_establishment.established_at + 1.day,
Expand Down