-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LUPEYALPHA-1162] practitioner_claim_submitted_at for EY practitioner…
… journey
- Loading branch information
Showing
10 changed files
with
56 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -318,3 +318,4 @@ shared: | |
- returning_within_6_months | ||
- created_at | ||
- updated_at | ||
- practitioner_claim_submitted_at |
5 changes: 5 additions & 0 deletions
5
...0241015093740_add_practitioner_claim_submitted_at_to_early_years_payment_eligibilities.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,5 @@ | ||
class AddPractitionerClaimSubmittedAtToEarlyYearsPaymentEligibilities < ActiveRecord::Migration[7.0] | ||
def change | ||
add_column :early_years_payment_eligibilities, :practitioner_claim_submitted_at, :datetime | ||
end | ||
end |
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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
FactoryBot.define do | ||
factory :early_years_payments_eligibility, class: "Policies::EarlyYearsPayments::Eligibility" do | ||
trait :practitioner_claim_submitted do | ||
practitioner_claim_submitted_at { Time.zone.now } | ||
end | ||
end | ||
end |
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 |
---|---|---|
|
@@ -6,7 +6,8 @@ | |
:claim, | ||
policy: Policies::EarlyYearsPayments, | ||
reference: "foo", | ||
practitioner_email_address: "[email protected]" | ||
practitioner_email_address: "[email protected]", | ||
submitted_at: Time.zone.now | ||
) | ||
end | ||
|
||
|
@@ -67,7 +68,7 @@ | |
:claim, | ||
:submitted, | ||
policy: Policies::EarlyYearsPayments, | ||
eligibility: build(:early_years_payments_eligibility, nursery_urn: eligible_ey_provider.urn), | ||
eligibility: build(:early_years_payments_eligibility, :practitioner_claim_submitted, nursery_urn: eligible_ey_provider.urn), | ||
reference: "foo", | ||
practitioner_email_address: "[email protected]" | ||
) | ||
|
17 changes: 8 additions & 9 deletions
17
spec/features/early_years_payment/practitioner/happy_path_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 |
---|---|---|
@@ -1,19 +1,18 @@ | ||
require "rails_helper" | ||
|
||
RSpec.feature "Early years payment practitioner" do | ||
let(:claim) do | ||
create( | ||
:claim, | ||
policy: Policies::EarlyYearsPayments, | ||
reference: "foo", | ||
practitioner_email_address: "[email protected]" | ||
) | ||
end | ||
let(:email_address) { "[email protected]" } | ||
let(:journey_session) { Journeys::EarlyYearsPayment::Provider::Authenticated::Session.last } | ||
let(:mail) { ActionMailer::Base.deliveries.last } | ||
let(:magic_link) { mail[:personalisation].unparsed_value[:magic_link] } | ||
let!(:nursery) { create(:eligible_ey_provider, primary_key_contact_email_address: email_address) } | ||
let(:claim) { Claim.last } | ||
|
||
scenario "Happy path" do | ||
when_early_years_payment_provider_authenticated_journey_submitted | ||
when_early_years_payment_practitioner_journey_configuration_exists | ||
|
||
visit "/early-years-payment-practitioner/find-reference?skip_landing_page=true&email=user@example.com" | ||
visit "/early-years-payment-practitioner/find-reference?skip_landing_page=true&email=practitioner@example.com" | ||
expect(page).to have_content "Enter your claim reference" | ||
fill_in "Claim reference number", with: claim.reference | ||
click_button "Submit" | ||
|
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 |
---|---|---|
|
@@ -28,3 +28,12 @@ def when_early_years_payment_provider_authenticated_journey_ready_to_submit | |
fill_in "claim-practitioner-email-address-field", with: "[email protected]" | ||
click_button "Continue" | ||
end | ||
|
||
def when_early_years_payment_provider_authenticated_journey_submitted | ||
when_early_years_payment_provider_authenticated_journey_configuration_exists | ||
when_early_years_payment_provider_start_journey_completed | ||
when_early_years_payment_provider_authenticated_journey_ready_to_submit | ||
|
||
fill_in "claim-provider-contact-name-field", with: "John Doe" | ||
click_button "Accept and send" | ||
end |