Skip to content

Commit f8996dc

Browse files
committed
Add branching_enabled to routing_page view
The routing page view now accesses the branching_enabled flag and the tests have been changed.
1 parent 2b0579a commit f8996dc

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

app/views/pages/conditions/routing_page.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="govuk-grid-column-two-thirds">
55

66
<% if policy(form).can_add_page_routing_conditions? %>
7-
<%= render partial: "pages/conditions/routing_options", locals: {form:, routing_page_input:} %>
7+
<%= render partial: "pages/conditions/routing_options", locals: {form:, routing_page_input:, branching_enabled: @branching_enabled } %>
88
<% else %>
99
<h1 class="govuk-heading-l">
1010
<span class="govuk-caption-l"><%= form.name %> </span>
@@ -15,7 +15,7 @@
1515
<%= t("routing_page.body_routing_text") %>
1616
</p>
1717

18-
<% if FeatureService.enabled?(:branch_routing) %>
18+
<% if @branching_enabled %>
1919
<p>
2020
<%= t("routing_page.body_branching_text") %>
2121
</p>

spec/views/pages/conditions/routing_page.html.erb_spec.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
let(:routing_page_input) { Pages::RoutingPageInput.new }
77
let(:allowed_to_create_routes) { true }
88
let(:all_routes_created) { false }
9+
let(:branching_enabled) { false }
910

1011
before do
1112
without_partial_double_verification do
@@ -15,6 +16,8 @@
1516
allow(view).to receive_messages(form_pages_path: "/forms/1/pages", routing_page_path: "/forms/1/new-condition", set_routing_page_path: "/forms/1/new-condition")
1617
allow(form).to receive_messages(qualifying_route_pages: pages, has_no_remaining_routes_available?: all_routes_created)
1718

19+
assign(:branching_enabled, branching_enabled)
20+
1821
render template: "pages/conditions/routing_page", locals: { form:, routing_page_input: }
1922
end
2023

@@ -28,12 +31,14 @@
2831
end
2932

3033
context "when branch routing is enabled", :feature_branch_routing do
34+
let(:branching_enabled) { true }
35+
3136
it "contains content explaining branch routing" do
3237
expect(rendered).to have_text "you can make them skip one or more questions later in the form"
3338
end
3439
end
3540

36-
context "when branch routing is not enabled", feature_branch_routing: false do
41+
context "when branch routing is not enabled" do
3742
it "does not contain content explaining branch routing" do
3843
expect(rendered).not_to have_text "you can make them skip one or more questions later in the form"
3944
end

0 commit comments

Comments
 (0)