Skip to content

Commit

Permalink
Remove related links AB test
Browse files Browse the repository at this point in the history
This is no longer active.
  • Loading branch information
sihugh committed May 24, 2019
1 parent 51f762e commit 6beade8
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 95 deletions.
2 changes: 0 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ class ApplicationController < ActionController::Base
# For APIs, you may want to use :null_session instead.
protect_from_forgery except: :service_sign_in_options

include ABTestable

private

def content_item_path
Expand Down
29 changes: 0 additions & 29 deletions app/controllers/concerns/ab_testable.rb

This file was deleted.

5 changes: 0 additions & 5 deletions app/controllers/content_items_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ def set_guide_draft_access_token

def load_content_item
content_item = Services.content_store.content_item(content_item_path)

if related_links_variant.variant?('C') && content_item.dig('links')
content_item['links']['ordered_related_items'] = content_item['links'].fetch('suggested_ordered_related_items', [])
end

@content_item = PresenterBuilder.new(content_item, content_item_path).presenter
end

Expand Down
2 changes: 0 additions & 2 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
<%= csrf_meta_tags %>
<%= render 'govuk_publishing_components/components/meta_tags', content_item: @content_item.content_item %>

<%= related_links_variant.analytics_meta_tag.html_safe %>

<% if @content_item.description %>
<meta name="description" content="<%= strip_tags(@content_item.description) %>" />
<% end %>
Expand Down
40 changes: 0 additions & 40 deletions test/controllers/content_items_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,46 +130,6 @@ class ContentItemsControllerTest < ActionController::TestCase
assert_equal content_item['title'], assigns[:content_item].title
end

test "gets item from the content store and keeps ordered_related_items when running RelatedLinksABTest4 misclassification variant" do
with_variant RelatedLinksABTest4: 'A' do
content_item = content_store_has_schema_example('case_study', 'case_study')

get :show, params: { path: path_for(content_item) }
assert_response :success
assert_equal content_item['links']['ordered_related_items'], assigns[:content_item].content_item['links']['ordered_related_items']
end
end

test "gets item from the content store and keeps ordered_related_items when running RelatedLinksABTest4 control variant" do
with_variant RelatedLinksABTest4: 'B' do
content_item = content_store_has_schema_example('case_study', 'case_study')

get :show, params: { path: path_for(content_item) }
assert_response :success
assert_equal content_item['links']['ordered_related_items'], assigns[:content_item].content_item['links']['ordered_related_items']
end
end

test "gets item from the content store and replaces ordered_related_items when running RelatedLinksABTest4 test variant" do
with_variant RelatedLinksABTest4: 'C' do
content_item = content_store_has_schema_example('case_study', 'case_study')

get :show, params: { path: path_for(content_item) }
assert_response :success
assert_equal assigns[:content_item].content_item['links']['ordered_related_items'], assigns[:content_item].content_item['links']['suggested_ordered_related_items']
end
end

test "gets item from the content store and replaces ordered_related_items when empty array when RelatedLinksABTest4 test variant has no suggestions" do
with_variant RelatedLinksABTest4: 'C' do
content_item = content_store_has_schema_example('guide', 'guide')

get :show, params: { path: path_for(content_item) }
assert_response :success
assert_equal [], assigns[:content_item].content_item['links']['ordered_related_items']
end
end

test "sets the expiry as sent by content-store" do
content_item = content_store_has_schema_example('coming_soon', 'coming_soon')
content_store_has_item(content_item['base_path'], content_item, max_age: 20)
Expand Down
17 changes: 0 additions & 17 deletions test/controllers/development_controller_test.rb

This file was deleted.

0 comments on commit 6beade8

Please sign in to comment.