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

Fix flow for overseas businesses #791

Merged
merged 1 commit into from
Apr 8, 2020
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ module CanUseNewRegistrationWorkflow
if: :should_register_in_wales?

transitions from: :location_form,
to: :other_businesses_form,
to: :check_your_tier_form,
if: :overseas?

transitions from: :location_form,
Expand Down Expand Up @@ -352,6 +352,10 @@ module CanUseNewRegistrationWorkflow
transitions from: :business_type_form,
to: :location_form

transitions from: :check_your_tier_form,
to: :location_form,
if: :overseas?

transitions from: :check_your_tier_form,
to: :business_type_form

Expand Down Expand Up @@ -391,10 +395,6 @@ module CanUseNewRegistrationWorkflow
transitions from: :company_name_form,
to: :registration_number_form

transitions from: :other_businesses_form,
to: :location_form,
if: :overseas?

transitions from: :other_businesses_form,
to: :check_your_tier_form

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ module WasteCarriersEngine
end

context "on back" do
context "if the company is based overseas" do
subject { build(:new_registration, workflow_state: "check_your_tier_form", location: "overseas") }

include_examples "has back transition", previous_state: "location_form"
end

subject { build(:new_registration, workflow_state: "check_your_tier_form") }

include_examples "has back transition", previous_state: "business_type_form"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module WasteCarriersEngine
context "when the location is not in the UK" do
let(:location) { "overseas" }

include_examples "has next transition", next_state: "other_businesses_form"
include_examples "has next transition", next_state: "check_your_tier_form"
end

context "when the location is in england" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ module WasteCarriersEngine
end

context "on back" do
context "if the company is based overseas" do
subject { build(:new_registration, workflow_state: "other_businesses_form", location: "overseas") }

include_examples "has back transition", previous_state: "location_form"
end

include_examples "has back transition", previous_state: "check_your_tier_form"
end
end
Expand Down