Skip to content

Commit

Permalink
Update variant for Related Links A/B test v4
Browse files Browse the repository at this point in the history
This commit updates the A/B test variant for related links from RelatedLinksABTest3 to RelatedLinksABTest4. This is to support the fourth iteration of the A/B test which is using a new set of related link data.
  • Loading branch information
Karl Baker committed Mar 20, 2019
1 parent eecf75c commit f8c4463
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion app/controllers/concerns/ab_testable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def related_links_variant

def related_links_test
@related_links_test ||= GovukAbTesting::AbTest.new(
"RelatedLinksABTest3",
"RelatedLinksABTest4",
dimension: RELATED_LINKS_DIMENSION,
allowed_variants: %w(A B C),
control_variant: "A"
Expand Down
16 changes: 8 additions & 8 deletions test/controllers/content_items_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ 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 RelatedLinksABTest3 misclassification variant" do
with_variant RelatedLinksABTest3: 'A' do
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) }
Expand All @@ -140,8 +140,8 @@ class ContentItemsControllerTest < ActionController::TestCase
end
end

test "gets item from the content store and keeps ordered_related_items when running RelatedLinksABTest3 control variant" do
with_variant RelatedLinksABTest3: 'B' do
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) }
Expand All @@ -150,8 +150,8 @@ class ContentItemsControllerTest < ActionController::TestCase
end
end

test "gets item from the content store and replaces ordered_related_items when running RelatedLinksABTest3 test variant" do
with_variant RelatedLinksABTest3: 'C' do
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) }
Expand All @@ -160,8 +160,8 @@ class ContentItemsControllerTest < ActionController::TestCase
end
end

test "gets item from the content store and replaces ordered_related_items when empty array when RelatedLinksABTest3 test variant has no suggestions" do
with_variant RelatedLinksABTest3: 'C' do
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) }
Expand Down
4 changes: 2 additions & 2 deletions test/controllers/development_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class DevelopmentControllerTest < ActionController::TestCase
include GovukAbTesting::MinitestHelpers

%w(A B C).each do |test_variant|
test "RelatedLinksABTest3 works correctly for each variant (variant: #{test_variant})" do
with_variant RelatedLinksABTest3: test_variant do
test "RelatedLinksABTest4 works correctly for each variant (variant: #{test_variant})" do
with_variant RelatedLinksABTest4: test_variant do
get :index

ab_test = @controller.send(:related_links_test)
Expand Down

0 comments on commit f8c4463

Please sign in to comment.