Skip to content

Commit

Permalink
Merge pull request #3930 from alphagov/2314-remove-the-ab-test-on-the…
Browse files Browse the repository at this point in the history
…-homepage

Remove the AB test on the homepage
  • Loading branch information
hannako authored Jan 18, 2024
2 parents 66874f1 + 449ebd3 commit deeb15f
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 145 deletions.
49 changes: 0 additions & 49 deletions app/controllers/concerns/homepage_popular_links_ab_testable.rb

This file was deleted.

2 changes: 0 additions & 2 deletions app/controllers/homepage_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
class HomepageController < ContentItemsController
include Cacheable
include HomepagePopularLinksAbTestable

slimmer_template "gem_layout_homepage"

def index
Expand Down
14 changes: 2 additions & 12 deletions app/views/homepage/_popular_links.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@
add_view_stylesheet("popular_links")
%>

<% if variant_b_page? %>
<% popular_links = t("homepage.index.popular_links_b") %>
<% elsif variant_c_page? %>
<% popular_links = t("homepage.index.popular_links_c") %>
<% elsif variant_d_page? %>
<% popular_links = t("homepage.index.popular_links_d") %>
<% else %>
<% popular_links = t("homepage.index.popular_links") %>
<% end %>

<section class="homepage-section homepage-section__popular-links">
<div class="govuk-width-container">
<div class="govuk-grid-row">
Expand All @@ -22,7 +12,7 @@
text: t("homepage.index.popular_links_heading"),
} %>
<ul class="homepage-most-viewed-list" data-module="gem-track-click ga4-link-tracker">
<% popular_links.each_with_index do | item, index | %>
<% t("homepage.index.popular_links").each_with_index do | item, index | %>
<li class="homepage-most-viewed-list__item">
<%= render "govuk_publishing_components/components/action_link", {
text: item[:text],
Expand All @@ -41,7 +31,7 @@
'index_section': locals[:index_section],
'index_link': index + 1,
'index_section_count': locals[:index_section_count],
'index_total': popular_links.length,
'index_total': t("homepage.index.popular_links").length,
'section': "#{t("homepage.index.popular_links_heading", locale: :en)}"
}
}
Expand Down
1 change: 0 additions & 1 deletion app/views/homepage/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<% add_view_stylesheet("homepage")%>
<% content_for :extra_headers do %>
<%= homepage_popular_links_ab_test_variant.analytics_meta_tag.html_safe if page_under_test? %>
<link rel="canonical" href="<%= Frontend.govuk_website_root + root_path %>">
<meta name="description" content="<%= t("homepage.index.meta_description_new") %>">
<% end %>
Expand Down
3 changes: 0 additions & 3 deletions config/locales/cy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -931,9 +931,6 @@ cy:
more:
popular_links_heading:
popular_links:
popular_links_b:
popular_links_c:
popular_links_d:
more_links:
other_agencies:
other_agencies_count:
Expand Down
39 changes: 0 additions & 39 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -581,45 +581,6 @@ en:
href: /check-national-insurance-record
- text: 'Check MOT history of a vehicle'
href: /check-mot-history
popular_links_b:
- text: 'Universal Credit account: sign in'
href: /sign-in-universal-credit
- text: 'Check MOT history of a vehicle'
href: /check-mot-history
- text: 'HMRC online services: sign in or set up an account'
href: /log-in-register-hmrc-online-services
- text: 'Get information about a company'
href: /get-information-about-a-company
- text: 'Tax your vehicle'
href: /vehicle-tax
- text: 'Check if a vehicle is taxed'
href: /check-vehicle-tax
popular_links_c:
- text: 'HMRC online services: sign in or set up an account'
href: /log-in-register-hmrc-online-services
- text: 'Check your State Pension forecast'
href: /check-state-pension
- text: 'Personal tax account: sign in or set up'
href: /personal-tax-account
- text: 'Sign in to your childcare account'
href: /sign-in-childcare-account
- text: 'File your Self Assessment tax return online'
href: /log-in-file-self-assessment-tax-return
- text: 'Universal Credit account: sign in'
href: /sign-in-universal-credit
popular_links_d:
- text: 'Change your driving test appointment'
href: /change-driving-test
- text: 'Book your driving test'
href: /book-driving-test
- text: 'Universal Credit account: sign in'
href: /sign-in-universal-credit
- text: 'HMRC online services: sign in or set up an account'
href: /log-in-register-hmrc-online-services
- text: 'Find an energy certificate'
href: /find-energy-certificate
- text: 'Student finance login'
href: /student-finance-register-login
# If adding or removing items remember to update the `columns()` mixin in
# the homepage-most-active-list class in _homepage.scss.
more_links:
Expand Down
39 changes: 0 additions & 39 deletions test/integration/homepage_test.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
require "integration_test_helper"

class HomepageTest < ActionDispatch::IntegrationTest
include GovukAbTesting::MinitestHelpers

setup do
stub_content_store_has_item("/", schema: "special_route")
end
Expand Down Expand Up @@ -41,41 +39,4 @@ class HomepageTest < ActionDispatch::IntegrationTest
assert page.has_content?(I18n.t("homepage.index.government_activity_description", locale: :en))
end
end

context "when AB testing different popular links" do
should "have different links for the B variant" do
with_variant HomepagePopularLinksTest: "B" do
visit "/"
assert page.has_text?("Get information about a company")
end
end

should "have different links for the A variant" do
with_variant HomepagePopularLinksTest: "A" do
visit "/"
assert page.has_text?("Find out about help you can get with your energy bills")
end
end

should "have different links for the Z variant" do
with_variant HomepagePopularLinksTest: "Z" do
visit "/"
assert page.has_text?("Find out about help you can get with your energy bills")
end
end

should "have different links for the C variant" do
with_variant HomepagePopularLinksTest: "C" do
visit "/"
assert page.has_text?("Sign in to your childcare account")
end
end

should "have different links for the D variant" do
with_variant HomepagePopularLinksTest: "D" do
visit "/"
assert page.has_text?("Find an energy certificate")
end
end
end
end

0 comments on commit deeb15f

Please sign in to comment.