Skip to content

Commit

Permalink
set eligibility.practitioner_claim_submitted_at
Browse files Browse the repository at this point in the history
  • Loading branch information
alkesh committed Oct 17, 2024
1 parent 8ff5763 commit 3f71f04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ def generate_policy_options_provided

def build_or_find_claim
claim = Claim.find_by(reference: journey_session.answers.reference_number) || new_claim
# TODO - set a new field: eligibility.practitioner_claim_started_at?
set_claim_attributes_from_answers(claim, answers)

claim.eligibility.practitioner_claim_submitted_at = Time.zone.now
# TODO - do we need to set a new field here?: eligibility.practitioner_claim_started_at
claim
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,15 @@
expect(page).to have_text(I18n.t("forms.gender.questions.payroll_gender"))
choose "Female"
click_on "Continue"

expect(page).to have_content("Check your answers before submitting this claim")
expect do
click_on "Accept and send"
end.to change { Claim.count }.by(0)
.and change { Policies::EarlyYearsPayments::Eligibility.count }.by(0)

expect(claim.eligibility.reload.practitioner_claim_submitted_at).to be_present

# check answers were saved on the claim
expect(claim.reload.national_insurance_number).to eq "PX321499A"
end
Expand Down

0 comments on commit 3f71f04

Please sign in to comment.