Skip to content

Commit

Permalink
happy path feature spec
Browse files Browse the repository at this point in the history
  • Loading branch information
alkesh committed Sep 26, 2024
1 parent ef304d0 commit 552f493
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/factories/journey_configurations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
routing_name { Journeys::EarlyYearsPayment::Provider::Authenticated::ROUTING_NAME }
end

trait :early_years_payment_practitioner do
routing_name { Journeys::EarlyYearsPayment::Practitioner::ROUTING_NAME }
end

trait :closed do
open_for_submissions { false }
end
Expand Down
20 changes: 20 additions & 0 deletions spec/features/early_years_payment/practitioner/happy_path_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
require "rails_helper"

RSpec.feature "Early years payment practitioner" do
scenario "Happy path" do
when_early_years_payment_practitioner_journey_configuration_exists

visit landing_page_path(Journeys::EarlyYearsPayment::Practitioner::ROUTING_NAME)

# find-reference page stuff
visit claim_path(Journeys::EarlyYearsPayment::Practitioner::ROUTING_NAME, :claim) # temporary step until landing page implemented
click_on "Continue"

# one login stuff
click_on "Continue"

expect(page.title).to have_text("How we’ll use the information you provide")
expect(page).to have_content("How we’ll use the information you provide")
click_on "Continue"
end
end
4 changes: 4 additions & 0 deletions spec/support/steps/journey_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ def when_early_years_payment_provider_start_journey_configuration_exists
def when_early_years_payment_provider_authenticated_journey_configuration_exists
create(:journey_configuration, :early_years_payment_provider_authenticated)
end

def when_early_years_payment_practitioner_journey_configuration_exists
create(:journey_configuration, :early_years_payment_practitioner)
end

0 comments on commit 552f493

Please sign in to comment.