diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 83ae86502..bc20637d1 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -4,7 +4,6 @@ //= require govuk_publishing_components/components/error-summary //= require govuk_publishing_components/components/feedback //= require govuk_publishing_components/components/govspeak -//= require govuk_publishing_components/components/intervention //= require govuk_publishing_components/components/print-link //= require govuk_publishing_components/components/radio //= require govuk_publishing_components/components/step-by-step-nav diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 7e4c7a8d7..7cf7afeb3 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -27,7 +27,6 @@ $govuk-new-link-styles: true; @import 'govuk_publishing_components/components/hint'; @import 'govuk_publishing_components/components/image-card'; @import 'govuk_publishing_components/components/input'; -@import 'govuk_publishing_components/components/intervention'; @import 'govuk_publishing_components/components/inverse-header'; @import 'govuk_publishing_components/components/label'; @import 'govuk_publishing_components/components/lead-paragraph'; diff --git a/app/controllers/ab_tests/sab_pages_testable.rb b/app/controllers/ab_tests/sab_pages_testable.rb deleted file mode 100644 index f4b1a5f19..000000000 --- a/app/controllers/ab_tests/sab_pages_testable.rb +++ /dev/null @@ -1,41 +0,0 @@ -module AbTests::SabPagesTestable - CUSTOM_DIMENSION = 48 - - def self.included(base) - base.helper_method( - :sab_page_variant, - :is_testable_sab_page?, - :should_show_sab_intervention?, - ) - base.after_action :set_test_response_header - end - - def sab_page_variant - @sab_page_variant ||= sab_page_test.requested_variant(request.headers) - end - - def is_testable_sab_page? - @is_testable_sab_page ||= request.headers["HTTP_GOVUK_ABTEST_ISSTARTABUSINESSPAGE"] == "true" - end - - def should_show_sab_intervention? - sab_page_variant.variant?("B") && is_testable_sab_page? - end - -private - - def sab_page_test - @sab_page_test ||= GovukAbTesting::AbTest.new( - "StartABusinessSegment", - dimension: CUSTOM_DIMENSION, - allowed_variants: %w[A B C], - control_variant: "A", - ) - end - - def set_test_response_header - if is_testable_sab_page? - sab_page_variant.configure_response(response) - end - end -end diff --git a/app/controllers/content_items_controller.rb b/app/controllers/content_items_controller.rb index da831c83c..1e3bbc6d1 100644 --- a/app/controllers/content_items_controller.rb +++ b/app/controllers/content_items_controller.rb @@ -1,6 +1,4 @@ class ContentItemsController < ApplicationController - include AbTests::SabPagesTestable - rescue_from GdsApi::HTTPForbidden, with: :error_403 rescue_from GdsApi::HTTPNotFound, with: :error_notfound rescue_from GdsApi::HTTPGone, with: :error_410 diff --git a/app/views/content_items/_body_with_related_links.html.erb b/app/views/content_items/_body_with_related_links.html.erb index aaca7628c..597ff3889 100644 --- a/app/views/content_items/_body_with_related_links.html.erb +++ b/app/views/content_items/_body_with_related_links.html.erb @@ -9,8 +9,6 @@
- <%= render 'govuk_publishing_components/components/intervention' if should_show_sab_intervention? %> - <%= render 'govuk_publishing_components/components/govspeak', { direction: page_text_direction, disable_youtube_expansions: true, diff --git a/app/views/content_items/document_collection.html.erb b/app/views/content_items/document_collection.html.erb index 234382b7b..08273a19f 100644 --- a/app/views/content_items/document_collection.html.erb +++ b/app/views/content_items/document_collection.html.erb @@ -26,8 +26,6 @@ <%= render 'components/important-metadata', items: @content_item.important_metadata %> - <%= render 'govuk_publishing_components/components/intervention' if should_show_sab_intervention? %> - <%= render "components/contents-list-with-body", contents: @content_item.contents do %>
<%= render 'document_collection_body' %> diff --git a/app/views/content_items/guide.html.erb b/app/views/content_items/guide.html.erb index 1ed5dc716..2b999bf1b 100644 --- a/app/views/content_items/guide.html.erb +++ b/app/views/content_items/guide.html.erb @@ -18,8 +18,6 @@
<%= render 'govuk_publishing_components/components/title', { title: @content_item.content_title } %> - <%= render 'govuk_publishing_components/components/intervention' if should_show_sab_intervention? %> - <% if @content_item.show_guide_navigation? %> <%= render "govuk_publishing_components/components/skip_link", { text: t("guide.skip_to_contents"), diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index f3ff56d1f..c6ce899fc 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -22,7 +22,6 @@ <%= javascript_include_tag "application", integrity: false %> <%= csrf_meta_tags %> <%= render 'govuk_publishing_components/components/meta_tags', content_item: @content_item.content_item %> - <%= sab_page_variant.analytics_meta_tag.html_safe if is_testable_sab_page? %> <% if @content_item.description %> diff --git a/test/controllers/sab_ab_test.rb b/test/controllers/sab_ab_test.rb deleted file mode 100644 index 87f42a791..000000000 --- a/test/controllers/sab_ab_test.rb +++ /dev/null @@ -1,64 +0,0 @@ -require "test_helper" - -class ContentItemsControllerTest < ActionController::TestCase - include GovukAbTesting::MinitestHelpers - INTERVENTION_CSS_SELECTOR = "gem-c-intervention".freeze - - test "shows intervention for variant B" do - for_each_schema do |schema| - with_variant StartABusinessSegment: "B" do - with_is_sab_page_header("true") do - set_up_and_visit_content_item_for_schema(schema) - assert has_intervention_css_selector - end - end - end - end - - test "doesn't show intervention for variant A" do - for_each_schema do |schema| - with_variant StartABusinessSegment: "A" do - with_is_sab_page_header("true") do - set_up_and_visit_content_item_for_schema(schema) - - assert_not has_intervention_css_selector - end - end - end - end - - test "doesn't show intervention for variant C" do - for_each_schema do |schema| - with_variant StartABusinessSegment: "C" do - with_is_sab_page_header("true") do - set_up_and_visit_content_item_for_schema(schema) - - assert_not has_intervention_css_selector - end - end - end - end - -private - - def set_up_and_visit_content_item_for_schema(schema) - content_item = content_store_has_schema_example(schema, schema) - stub_content_store_has_item(content_item["base_path"], content_item) - path = content_item["base_path"][1..] - - get :show, params: { path: path } - end - - def has_intervention_css_selector - response.body.include?(INTERVENTION_CSS_SELECTOR) - end - - def with_is_sab_page_header(is_sab_header) - request.headers["HTTP_GOVUK_ABTEST_ISSTARTABUSINESSPAGE"] = is_sab_header - yield - end - - def for_each_schema(&block) - %w[guide answer document_collection].each(&block) - end -end