Skip to content

Commit

Permalink
Fixed failing rspecs (#18978)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevma50287 authored Jul 10, 2023
1 parent fd28618 commit 528eeb0
Showing 1 changed file with 50 additions and 0 deletions.
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

0 comments on commit 528eeb0

Please sign in to comment.