Skip to content

Commit 6c378ee

Browse files
committed
Remove underscores from AB test name
nginx no likey underscores in headers - https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#missing-disappearing-http-headers This was resulting in the HTTP header that Fastly sets for the AB test being dropped by one of the nginxs which sit in front of rails.
1 parent de26cdc commit 6c378ee

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/controllers/content_items_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def temporary_ab_test_find_utr_page
274274
placeholder = "{{ab_test_find_utr_number_video_links}}"
275275
if @content_item.base_path == "/find-utr-number" && @content_item.body.include?(placeholder)
276276
ab_test = GovukAbTesting::AbTest.new(
277-
"find_utr_number_video_links",
277+
"FindUtrNumberVideoLinks",
278278
dimension: 61, # https://docs.google.com/spreadsheets/d/1h4vGXzIbhOWwUzourPLIc8WM-iU1b6WYOVDOZxmU1Uo/edit#gid=254065189&range=69:69
279279
allowed_variants: %w[A B Z],
280280
control_variant: "Z",

test/controllers/content_items_controller_test.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ class ContentItemsControllerTest < ActionController::TestCase
371371

372372
stub_content_store_has_item(content_item["base_path"], content_item)
373373

374-
request.headers["HTTP_GOVUK_ABTEST_FIND_UTR_NUMBER_VIDEO_LINKS"] = nil
374+
request.headers["HTTP_GOVUK_ABTEST_FINDUTRNUMBERVIDEOLINKS"] = nil
375375

376376
get :show, params: { path: path_for(content_item) }
377377
assert_response :success
@@ -386,7 +386,7 @@ class ContentItemsControllerTest < ActionController::TestCase
386386

387387
stub_content_store_has_item(content_item["base_path"], content_item)
388388

389-
request.headers["HTTP_GOVUK_ABTEST_FIND_UTR_NUMBER_VIDEO_LINKS"] = "A"
389+
request.headers["HTTP_GOVUK_ABTEST_FINDUTRNUMBERVIDEOLINKS"] = "A"
390390

391391
get :show, params: { path: path_for(content_item) }
392392
assert_response :success
@@ -401,7 +401,7 @@ class ContentItemsControllerTest < ActionController::TestCase
401401

402402
stub_content_store_has_item(content_item["base_path"], content_item)
403403

404-
request.headers["HTTP_GOVUK_ABTEST_FIND_UTR_NUMBER_VIDEO_LINKS"] = "B"
404+
request.headers["HTTP_GOVUK_ABTEST_FINDUTRNUMBERVIDEOLINKS"] = "B"
405405

406406
get :show, params: { path: path_for(content_item) }
407407
assert_response :success

0 commit comments

Comments
 (0)