diff --git a/.review_apps/ecs_task_definition.tf b/.review_apps/ecs_task_definition.tf index 5e5d80902a..2309495542 100644 --- a/.review_apps/ecs_task_definition.tf +++ b/.review_apps/ecs_task_definition.tf @@ -25,7 +25,6 @@ locals { { name = "SETTINGS__AUTH_PROVIDER", value = "developer" }, { name = "SETTINGS__FORMS_ENV", value = "review" }, { name = "SETTINGS__FORMS_RUNNER__URL", value = "https://forms.service.gov.uk" }, - { name = "SETTINGS__FEATURES__DESCRIBE_NONE_OF_THE_ABOVE_ENABLED", value = "true" } ] } diff --git a/app/input_objects/pages/selection/base_options_input.rb b/app/input_objects/pages/selection/base_options_input.rb index d74fb64146..739bae0d66 100644 --- a/app/input_objects/pages/selection/base_options_input.rb +++ b/app/input_objects/pages/selection/base_options_input.rb @@ -20,11 +20,7 @@ def submit end def include_none_of_the_above_options - if FeatureService.enabled?(:describe_none_of_the_above_enabled) - [OpenStruct.new(id: "yes"), OpenStruct.new(id: "yes_with_question"), OpenStruct.new(id: "no")] - else - [OpenStruct.new(id: "yes"), OpenStruct.new(id: "no")] - end + [OpenStruct.new(id: "yes"), OpenStruct.new(id: "yes_with_question"), OpenStruct.new(id: "no")] end def include_none_of_the_above_with_question? diff --git a/config/settings.yml b/config/settings.yml index e61230216a..7b765e0c0f 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -4,7 +4,6 @@ features: enabled_by_group: true welsh: enabled_by_group: true - describe_none_of_the_above_enabled: false forms_api: # Authentication key to authenticate with forms-api diff --git a/spec/config/settings_spec.rb b/spec/config/settings_spec.rb index 94fcb3cc1d..355d6b8a7d 100644 --- a/spec/config/settings_spec.rb +++ b/spec/config/settings_spec.rb @@ -23,7 +23,6 @@ features = settings[:features] include_examples expected_value_test, :welsh, features, { "enabled_by_group" => true } - include_examples expected_value_test, :describe_none_of_the_above_enabled, features, false end describe "forms_api" do diff --git a/spec/features/form/add_or_edit_questions/add_a_question_for_each_type_of_answer_spec.rb b/spec/features/form/add_or_edit_questions/add_a_question_for_each_type_of_answer_spec.rb index b41ab51e1c..8d482b3e4b 100644 --- a/spec/features/form/add_or_edit_questions/add_a_question_for_each_type_of_answer_spec.rb +++ b/spec/features/form/add_or_edit_questions/add_a_question_for_each_type_of_answer_spec.rb @@ -8,8 +8,6 @@ create(:membership, group:, user: standard_user, added_by: standard_user) login_as standard_user - - allow(FeatureService).to receive(:enabled?).with(:describe_none_of_the_above_enabled).and_return(true) end context "when a form has no existing pages" do diff --git a/spec/support/shared_examples/pages_selection_base_options_input.rb b/spec/support/shared_examples/pages_selection_base_options_input.rb index c2e22fe4bb..5caca7a9c9 100644 --- a/spec/support/shared_examples/pages_selection_base_options_input.rb +++ b/spec/support/shared_examples/pages_selection_base_options_input.rb @@ -1,24 +1,7 @@ RSpec.shared_examples "base selection options input" do describe "#include_none_of_the_above_options" do - let(:describe_none_of_the_above_enabled) { true } - - before do - allow(FeatureService).to receive(:enabled?).with(:describe_none_of_the_above_enabled) - .and_return(describe_none_of_the_above_enabled) - end - - context "when the describe_none_of_the_above_enabled feature is enabled" do - it "includes an option for yes_with_question" do - 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")) - end - end - - context "when the describe_none_of_the_above_enabled feature is disabled" do - let(:describe_none_of_the_above_enabled) { false } - - it "does not include an option for yes_with_question" do - expect(input.include_none_of_the_above_options).to contain_exactly(OpenStruct.new(id: "yes"), OpenStruct.new(id: "no")) - end + it "has the expected radio options" do + 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")) end end diff --git a/spec/views/pages/selection/bulk_options.html.erb_spec.rb b/spec/views/pages/selection/bulk_options.html.erb_spec.rb index dc215dc29a..023d797df0 100644 --- a/spec/views/pages/selection/bulk_options.html.erb_spec.rb +++ b/spec/views/pages/selection/bulk_options.html.erb_spec.rb @@ -10,7 +10,6 @@ let(:selection_options) { [] } let(:page_number) { 1 } let(:back_link_url) { "/a-back-link-url" } - let(:describe_none_of_the_above_enabled) { true } before do form.reload @@ -23,8 +22,6 @@ allow(view).to receive_messages(form_pages_path: "/type-of-answer", current_form: form) end - allow(FeatureService).to receive(:enabled?).with(:describe_none_of_the_above_enabled).and_return(describe_none_of_the_above_enabled) - # # setup instance variables @bulk_options_input = bulk_options_input @bulk_options_path = selection_bulk_options_create_path(form.id) @@ -97,60 +94,50 @@ end describe "include none of the above radios" do - context "when the describe_none_of_the_above_enabled feature is enabled" do - it "contains a radio question for choosing whether to make the form live" do - expect(rendered).to have_css("fieldset", text: I18n.t("helpers.legend.pages_selection_bulk_options_input.include_none_of_the_above")) - expect(rendered).to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.yes"), type: "radio") - 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") - expect(rendered).to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.no"), type: "radio") - end - - context "when input object has value of yes'" do - let(:include_none_of_the_above) { "yes" } - - it "has 'Yes' radio selected" do - expect(rendered).to have_checked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes") - expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes_with_question") - expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "no") - end - end + it "contains a radio question for choosing whether to include an option for none of the above" do + expect(rendered).to have_css("fieldset", text: I18n.t("helpers.legend.pages_selection_bulk_options_input.include_none_of_the_above")) + expect(rendered).to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.yes"), type: "radio") + 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") + expect(rendered).to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.no"), type: "radio") + end - context "when input object has value of yes_with_question" do - let(:include_none_of_the_above) { "yes_with_question" } + context "when input object has value of yes'" do + let(:include_none_of_the_above) { "yes" } - it "has 'No' radio selected" do - expect(rendered).to have_checked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes_with_question") - expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes") - expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "no") - end + it "has 'Yes' radio selected" do + expect(rendered).to have_checked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes") + expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes_with_question") + expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "no") end + end - context "when input object has value of no" do - let(:include_none_of_the_above) { "no" } + context "when input object has value of yes_with_question" do + let(:include_none_of_the_above) { "yes_with_question" } - it "has 'No' radio selected" do - expect(rendered).to have_checked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "no") - expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes") - expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes_with_question") - end + it "has 'No' radio selected" do + expect(rendered).to have_checked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes_with_question") + expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes") + expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "no") end + end - context "when input object has no value set" do - let(:include_none_of_the_above) { nil } + context "when input object has value of no" do + let(:include_none_of_the_above) { "no" } - it "does not have a radio option selected" do - expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "no") - expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes") - expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes_with_question") - end + it "has 'No' radio selected" do + expect(rendered).to have_checked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "no") + expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes") + expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes_with_question") end end - context "when the describe_none_of_the_above_enabled feature is disabled" do - let(:describe_none_of_the_above_enabled) { false } + context "when input object has no value set" do + let(:include_none_of_the_above) { nil } - it "does not render the yes_with_question radio option" do - expect(rendered).not_to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.yes_with_question")) + it "does not have a radio option selected" do + expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "no") + expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes") + expect(rendered).to have_unchecked_field("pages_selection_bulk_options_input[include_none_of_the_above]", with: "yes_with_question") end end end diff --git a/spec/views/pages/selection/options.html.erb_spec.rb b/spec/views/pages/selection/options.html.erb_spec.rb index b2c8d11fa9..4d4fca972c 100644 --- a/spec/views/pages/selection/options.html.erb_spec.rb +++ b/spec/views/pages/selection/options.html.erb_spec.rb @@ -11,7 +11,6 @@ let(:include_none_of_the_above) { "yes" } let(:only_one_option) { "true" } let(:draft_question) { build :draft_question, answer_type: "selection", answer_settings: { only_one_option: } } - let(:describe_none_of_the_above_enabled) { true } before do # # mock the form.page_number method @@ -22,8 +21,6 @@ allow(view).to receive_messages(form_pages_path: "/pages", current_form: form) end - allow(FeatureService).to receive(:enabled?).with(:describe_none_of_the_above_enabled).and_return(describe_none_of_the_above_enabled) - # # setup instance variables assign(:page, page) assign(:selection_options_path, selection_options_path) @@ -126,60 +123,50 @@ end describe "include none of the above radios" do - context "when the describe_none_of_the_above_enabled feature is enabled" do - it "contains a radio question for choosing whether to make the form live" do - expect(rendered).to have_css("fieldset", text: I18n.t("helpers.legend.pages_selection_bulk_options_input.include_none_of_the_above")) - expect(rendered).to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.yes"), type: "radio") - 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") - expect(rendered).to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.no"), type: "radio") - end - - context "when input object has value of yes'" do - let(:include_none_of_the_above) { "yes" } - - it "has 'Yes' radio selected" do - expect(rendered).to have_checked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes") - expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes_with_question") - expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "no") - end - end + it "contains a radio question for choosing whether to include an option for none of the above" do + expect(rendered).to have_css("fieldset", text: I18n.t("helpers.legend.pages_selection_bulk_options_input.include_none_of_the_above")) + expect(rendered).to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.yes"), type: "radio") + 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") + expect(rendered).to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.no"), type: "radio") + end - context "when input object has value of yes_with_question" do - let(:include_none_of_the_above) { "yes_with_question" } + context "when input object has value of yes'" do + let(:include_none_of_the_above) { "yes" } - it "has 'No' radio selected" do - expect(rendered).to have_checked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes_with_question") - expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes") - expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "no") - end + it "has 'Yes' radio selected" do + expect(rendered).to have_checked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes") + expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes_with_question") + expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "no") end + end - context "when input object has value of no" do - let(:include_none_of_the_above) { "no" } + context "when input object has value of yes_with_question" do + let(:include_none_of_the_above) { "yes_with_question" } - it "has 'No' radio selected" do - expect(rendered).to have_checked_field("pages_selection_options_input[include_none_of_the_above]", with: "no") - expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes") - expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes_with_question") - end + it "has 'No' radio selected" do + expect(rendered).to have_checked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes_with_question") + expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes") + expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "no") end + end - context "when input object has no value set" do - let(:include_none_of_the_above) { nil } + context "when input object has value of no" do + let(:include_none_of_the_above) { "no" } - it "does not have a radio option selected" do - expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "no") - expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes") - expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes_with_question") - end + it "has 'No' radio selected" do + expect(rendered).to have_checked_field("pages_selection_options_input[include_none_of_the_above]", with: "no") + expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes") + expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes_with_question") end end - context "when the describe_none_of_the_above_enabled feature is disabled" do - let(:describe_none_of_the_above_enabled) { false } + context "when input object has no value set" do + let(:include_none_of_the_above) { nil } - it "does not render the yes_with_question radio option" do - expect(rendered).not_to have_field(I18n.t("helpers.label.pages_selection_bulk_options_input.include_none_of_the_above_options.yes_with_question")) + it "does not have a radio option selected" do + expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "no") + expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes") + expect(rendered).to have_unchecked_field("pages_selection_options_input[include_none_of_the_above]", with: "yes_with_question") end end end