Skip to content

Commit 97968b4

Browse files
authored
Merge pull request #2493 from alphagov/remove-none-of-the-above-feature-flag
Remove none of the above feature flag
2 parents 89ecc14 + 91687b6 commit 97968b4

8 files changed

Lines changed: 67 additions & 119 deletions

File tree

.review_apps/ecs_task_definition.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ locals {
2525
{ name = "SETTINGS__AUTH_PROVIDER", value = "developer" },
2626
{ name = "SETTINGS__FORMS_ENV", value = "review" },
2727
{ name = "SETTINGS__FORMS_RUNNER__URL", value = "https://forms.service.gov.uk" },
28-
{ name = "SETTINGS__FEATURES__DESCRIBE_NONE_OF_THE_ABOVE_ENABLED", value = "true" }
2928
]
3029
}
3130

app/input_objects/pages/selection/base_options_input.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ def submit
2020
end
2121

2222
def include_none_of_the_above_options
23-
if FeatureService.enabled?(:describe_none_of_the_above_enabled)
24-
[OpenStruct.new(id: "yes"), OpenStruct.new(id: "yes_with_question"), OpenStruct.new(id: "no")]
25-
else
26-
[OpenStruct.new(id: "yes"), OpenStruct.new(id: "no")]
27-
end
23+
[OpenStruct.new(id: "yes"), OpenStruct.new(id: "yes_with_question"), OpenStruct.new(id: "no")]
2824
end
2925

3026
def include_none_of_the_above_with_question?

config/settings.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ features:
44
enabled_by_group: true
55
welsh:
66
enabled_by_group: true
7-
describe_none_of_the_above_enabled: false
87

98
forms_api:
109
# Authentication key to authenticate with forms-api

spec/config/settings_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
features = settings[:features]
2424

2525
include_examples expected_value_test, :welsh, features, { "enabled_by_group" => true }
26-
include_examples expected_value_test, :describe_none_of_the_above_enabled, features, false
2726
end
2827

2928
describe "forms_api" do

spec/features/form/add_or_edit_questions/add_a_question_for_each_type_of_answer_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
create(:membership, group:, user: standard_user, added_by: standard_user)
99

1010
login_as standard_user
11-
12-
allow(FeatureService).to receive(:enabled?).with(:describe_none_of_the_above_enabled).and_return(true)
1311
end
1412

1513
context "when a form has no existing pages" do

spec/support/shared_examples/pages_selection_base_options_input.rb

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,7 @@
11
RSpec.shared_examples "base selection options input" do
22
describe "#include_none_of_the_above_options" do
3-
let(:describe_none_of_the_above_enabled) { true }
4-
5-
before do
6-
allow(FeatureService).to receive(:enabled?).with(:describe_none_of_the_above_enabled)
7-
.and_return(describe_none_of_the_above_enabled)
8-
end
9-
10-
context "when the describe_none_of_the_above_enabled feature is enabled" do
11-
it "includes an option for yes_with_question" do
12-
expect(input.include_none_of_the_above_options).to contain_exactly(OpenStruct.new(id: "yes"), OpenStruct.new(id: "yes_with_question"), OpenStruct.new(id: "no"))
13-
end
14-
end
15-
16-
context "when the describe_none_of_the_above_enabled feature is disabled" do
17-
let(:describe_none_of_the_above_enabled) { false }
18-
19-
it "does not include an option for yes_with_question" do
20-
expect(input.include_none_of_the_above_options).to contain_exactly(OpenStruct.new(id: "yes"), OpenStruct.new(id: "no"))
21-
end
3+
it "has the expected radio options" do
4+
expect(input.include_none_of_the_above_options).to contain_exactly(OpenStruct.new(id: "yes"), OpenStruct.new(id: "yes_with_question"), OpenStruct.new(id: "no"))
225
end
236
end
247

spec/views/pages/selection/bulk_options.html.erb_spec.rb

Lines changed: 32 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
let(:selection_options) { [] }
1111
let(:page_number) { 1 }
1212
let(:back_link_url) { "/a-back-link-url" }
13-
let(:describe_none_of_the_above_enabled) { true }
1413

1514
before do
1615
form.reload
@@ -23,8 +22,6 @@
2322
allow(view).to receive_messages(form_pages_path: "/type-of-answer", current_form: form)
2423
end
2524

26-
allow(FeatureService).to receive(:enabled?).with(:describe_none_of_the_above_enabled).and_return(describe_none_of_the_above_enabled)
27-
2825
# # setup instance variables
2926
@bulk_options_input = bulk_options_input
3027
@bulk_options_path = selection_bulk_options_create_path(form.id)
@@ -97,60 +94,50 @@
9794
end
9895

9996
describe "include none of the above radios" do
100-
context "when the describe_none_of_the_above_enabled feature is enabled" do
101-
it "contains a radio question for choosing whether to make the form live" do
102-
expect(rendered).to have_css("fieldset", text: I18n.t("helpers.legend.pages_selection_bulk_options_input.include_none_of_the_above"))
103-
expect(rendered).to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.yes"), type: "radio")
104-
expect(rendered).to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.yes_with_question"), type: "radio")
105-
expect(rendered).to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.no"), type: "radio")
106-
end
107-
108-
context "when input object has value of yes'" do
109-
let(:include_none_of_the_above) { "yes" }
110-
111-
it "has 'Yes' radio selected" do
112-
expect(rendered).to have_checked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes")
113-
expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes_with_question")
114-
expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "no")
115-
end
116-
end
97+
it "contains a radio question for choosing whether to include an option for none of the above" do
98+
expect(rendered).to have_css("fieldset", text: I18n.t("helpers.legend.pages_selection_bulk_options_input.include_none_of_the_above"))
99+
expect(rendered).to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.yes"), type: "radio")
100+
expect(rendered).to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.yes_with_question"), type: "radio")
101+
expect(rendered).to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.no"), type: "radio")
102+
end
117103

118-
context "when input object has value of yes_with_question" do
119-
let(:include_none_of_the_above) { "yes_with_question" }
104+
context "when input object has value of yes'" do
105+
let(:include_none_of_the_above) { "yes" }
120106

121-
it "has 'No' radio selected" do
122-
expect(rendered).to have_checked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes_with_question")
123-
expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes")
124-
expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "no")
125-
end
107+
it "has 'Yes' radio selected" do
108+
expect(rendered).to have_checked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes")
109+
expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes_with_question")
110+
expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "no")
126111
end
112+
end
127113

128-
context "when input object has value of no" do
129-
let(:include_none_of_the_above) { "no" }
114+
context "when input object has value of yes_with_question" do
115+
let(:include_none_of_the_above) { "yes_with_question" }
130116

131-
it "has 'No' radio selected" do
132-
expect(rendered).to have_checked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "no")
133-
expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes")
134-
expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes_with_question")
135-
end
117+
it "has 'No' radio selected" do
118+
expect(rendered).to have_checked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes_with_question")
119+
expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes")
120+
expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "no")
136121
end
122+
end
137123

138-
context "when input object has no value set" do
139-
let(:include_none_of_the_above) { nil }
124+
context "when input object has value of no" do
125+
let(:include_none_of_the_above) { "no" }
140126

141-
it "does not have a radio option selected" do
142-
expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "no")
143-
expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes")
144-
expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes_with_question")
145-
end
127+
it "has 'No' radio selected" do
128+
expect(rendered).to have_checked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "no")
129+
expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes")
130+
expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes_with_question")
146131
end
147132
end
148133

149-
context "when the describe_none_of_the_above_enabled feature is disabled" do
150-
let(:describe_none_of_the_above_enabled) { false }
134+
context "when input object has no value set" do
135+
let(:include_none_of_the_above) { nil }
151136

152-
it "does not render the yes_with_question radio option" do
153-
expect(rendered).not_to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.yes_with_question"))
137+
it "does not have a radio option selected" do
138+
expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "no")
139+
expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes")
140+
expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes_with_question")
154141
end
155142
end
156143
end

spec/views/pages/selection/options.html.erb_spec.rb

Lines changed: 32 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
let(:include_none_of_the_above) { "yes" }
1212
let(:only_one_option) { "true" }
1313
let(:draft_question) { build :draft_question, answer_type: "selection", answer_settings: { only_one_option: } }
14-
let(:describe_none_of_the_above_enabled) { true }
1514

1615
before do
1716
# # mock the form.page_number method
@@ -22,8 +21,6 @@
2221
allow(view).to receive_messages(form_pages_path: "/pages", current_form: form)
2322
end
2423

25-
allow(FeatureService).to receive(:enabled?).with(:describe_none_of_the_above_enabled).and_return(describe_none_of_the_above_enabled)
26-
2724
# # setup instance variables
2825
assign(:page, page)
2926
assign(:selection_options_path, selection_options_path)
@@ -126,60 +123,50 @@
126123
end
127124

128125
describe "include none of the above radios" do
129-
context "when the describe_none_of_the_above_enabled feature is enabled" do
130-
it "contains a radio question for choosing whether to make the form live" do
131-
expect(rendered).to have_css("fieldset", text: I18n.t("helpers.legend.pages_selection_bulk_options_input.include_none_of_the_above"))
132-
expect(rendered).to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.yes"), type: "radio")
133-
expect(rendered).to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.yes_with_question"), type: "radio")
134-
expect(rendered).to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.no"), type: "radio")
135-
end
136-
137-
context "when input object has value of yes'" do
138-
let(:include_none_of_the_above) { "yes" }
139-
140-
it "has 'Yes' radio selected" do
141-
expect(rendered).to have_checked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes")
142-
expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes_with_question")
143-
expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "no")
144-
end
145-
end
126+
it "contains a radio question for choosing whether to include an option for none of the above" do
127+
expect(rendered).to have_css("fieldset", text: I18n.t("helpers.legend.pages_selection_bulk_options_input.include_none_of_the_above"))
128+
expect(rendered).to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.yes"), type: "radio")
129+
expect(rendered).to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.yes_with_question"), type: "radio")
130+
expect(rendered).to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.no"), type: "radio")
131+
end
146132

147-
context "when input object has value of yes_with_question" do
148-
let(:include_none_of_the_above) { "yes_with_question" }
133+
context "when input object has value of yes'" do
134+
let(:include_none_of_the_above) { "yes" }
149135

150-
it "has 'No' radio selected" do
151-
expect(rendered).to have_checked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes_with_question")
152-
expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes")
153-
expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "no")
154-
end
136+
it "has 'Yes' radio selected" do
137+
expect(rendered).to have_checked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes")
138+
expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes_with_question")
139+
expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "no")
155140
end
141+
end
156142

157-
context "when input object has value of no" do
158-
let(:include_none_of_the_above) { "no" }
143+
context "when input object has value of yes_with_question" do
144+
let(:include_none_of_the_above) { "yes_with_question" }
159145

160-
it "has 'No' radio selected" do
161-
expect(rendered).to have_checked_field("pages_selection_options_input[include_none_of_the_above]", with: "no")
162-
expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes")
163-
expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes_with_question")
164-
end
146+
it "has 'No' radio selected" do
147+
expect(rendered).to have_checked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes_with_question")
148+
expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes")
149+
expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "no")
165150
end
151+
end
166152

167-
context "when input object has no value set" do
168-
let(:include_none_of_the_above) { nil }
153+
context "when input object has value of no" do
154+
let(:include_none_of_the_above) { "no" }
169155

170-
it "does not have a radio option selected" do
171-
expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "no")
172-
expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes")
173-
expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes_with_question")
174-
end
156+
it "has 'No' radio selected" do
157+
expect(rendered).to have_checked_field("pages_selection_options_input[include_none_of_the_above]", with: "no")
158+
expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes")
159+
expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes_with_question")
175160
end
176161
end
177162

178-
context "when the describe_none_of_the_above_enabled feature is disabled" do
179-
let(:describe_none_of_the_above_enabled) { false }
163+
context "when input object has no value set" do
164+
let(:include_none_of_the_above) { nil }
180165

181-
it "does not render the yes_with_question radio option" do
182-
expect(rendered).not_to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.yes_with_question"))
166+
it "does not have a radio option selected" do
167+
expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "no")
168+
expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes")
169+
expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes_with_question")
183170
end
184171
end
185172
end

0 commit comments

Comments
 (0)