Skip to content

Commit

Permalink
Merge pull request #3123 from alphagov/remove-running-aa-test-search-all
Browse files Browse the repository at this point in the history
Remove AA test config
  • Loading branch information
Rosa-Fox authored Jul 31, 2023
2 parents 47ec145 + 3c2b277 commit 0ad73b2
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 78 deletions.
19 changes: 0 additions & 19 deletions app/controllers/ab_tests/elastic_search_aa_testable.rb

This file was deleted.

7 changes: 1 addition & 6 deletions app/controllers/finders_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
class FindersController < ApplicationController
layout "finder_layout"
include AbTests::ElasticSearchAaTestable

before_action do
set_expiry(content_item)
Expand All @@ -9,10 +8,6 @@ class FindersController < ApplicationController
def show
slimmer_template "gem_layout_full_width" if i_am_a_topic_page_finder

if page_under_test?
set_requested_variant
end

respond_to do |format|
format.html do
raise UnsupportedContentItem unless content_item.is_finder?
Expand Down Expand Up @@ -63,7 +58,7 @@ class UnsupportedContentItem < StandardError; end

attr_reader :search_query

helper_method :facet_tags, :i_am_a_topic_page_finder, :result_set_presenter, :content_item, :signup_links, :filter_params, :facets, :page_under_test?
helper_method :facet_tags, :i_am_a_topic_page_finder, :result_set_presenter, :content_item, :signup_links, :filter_params, :facets

def redirect_to_destination
@redirect = content_item.redirect
Expand Down
6 changes: 0 additions & 6 deletions app/views/finders/_show_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@
<% end %>
</div>

<% if page_under_test? %>
<% content_for :meta_tags do %>
<%= @requested_variant.analytics_meta_tag.html_safe %>
<% end %>
<% end %>
<% if content_item.summary %>
<div class="govuk-grid-column-two-thirds">
<div class="metadata-summary ">
Expand Down
1 change: 0 additions & 1 deletion app/views/layouts/finder_layout.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<% end %>
<meta name="govuk:base_title" content="<%= yield :meta_title %> - GOV.UK">
<meta name="govuk:scroll-tracker" content="" data-module="ga4-scroll-tracker"/>
<%= yield :meta_tags %>
</head>

<body class="<%= yield :body_classes %>">
Expand Down
46 changes: 0 additions & 46 deletions spec/controllers/finders_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,52 +109,6 @@
get :show, params: { slug: "lunch-finder" }
expect(response.status).to eq(406)
end

context "with AA test" do
%w[A B Z].each do |variant|
it "renders the #{variant} variant for /search/all pages" do
stub_content_store_has_item(
"/search/all",
all_content_finder,
)

@request.headers["GOVUK-ABTest-EsSixPointSeven"] = variant

get :show, params: { slug: "search/all" }

expect(response.header["Vary"]).to eq("GOVUK-ABTest-EsSixPointSeven")
expect(response.body).to include("EsSixPointSeven:#{variant}")
end

it "doesn't render the #{variant} for finders" do
stub_content_store_has_item(
"/lunch-finder",
lunch_finder,
)

@request.headers["GOVUK-ABTest-EsSixPointSeven"] = variant

get :show, params: { slug: "lunch-finder" }

expect(response.status).to eq(200)
expect(response.header["Vary"]).not_to eq("GOVUK-ABTest-EsSixPointSeven")
expect(response.body).not_to include("EsSixPointSeven:#{variant}")
end
end

it "should render the page without an AB test variant for search" do
stub_content_store_has_item(
"/search/all",
all_content_finder,
)

get :show, params: { slug: "search/all" }

expect(response.status).to eq(200)
expect(response.header["Vary"]).to eq("GOVUK-ABTest-EsSixPointSeven")
expect(response.body).not_to include("<meta name=\"govuk:ab-test\">")
end
end
end

describe "a finder content item with a default order exists" do
Expand Down

0 comments on commit 0ad73b2

Please sign in to comment.