Skip to content

Commit

Permalink
DT/ACB - AB test for video in stop-self-employed page
Browse files Browse the repository at this point in the history
  • Loading branch information
Ana Botto committed Dec 19, 2023
1 parent e26438e commit e78844a
Show file tree
Hide file tree
Showing 68 changed files with 336 additions and 0 deletions.
27 changes: 27 additions & 0 deletions app/controllers/content_items_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def show
load_content_item

temporary_ab_test_find_utr_page
temporary_ab_test_stop_self_employed
set_expiry

if is_service_manual?
Expand Down Expand Up @@ -294,4 +295,30 @@ def temporary_ab_test_find_utr_page
end
end
# /TEMPORARY


def temporary_ab_test_stop_self_employed
placeholder = "{{ab_test_sa_video_stop_self_employed}}"
if @content_item.base_path == "/stop-being-self-employed" && @content_item.body.include?(placeholder)
ab_test = GovukAbTesting::AbTest.new(
"SAVideoStopSelfEmployed",
dimension: 47, # https://docs.google.com/spreadsheets/d/1h4vGXzIbhOWwUzourPLIc8WM-iU1b6WYOVDOZxmU1Uo/edit#gid=254065189&range=69:69
allowed_variants: %w[A B Z],
control_variant: "Z",
)
@requested_variant = ab_test.requested_variant(request.headers)
@requested_variant.configure_response(response)

replacement = case @requested_variant.variant_name
when "A"
I18n.t("ab_tests.sa_video_stop_self_employed.A")
when "B"
I18n.t("ab_tests.sa_video_stop_self_employed.B")
else
I18n.t("ab_tests.sa_video_stop_self_employed.Z")
end
@content_item.body.sub!(placeholder, replacement)
end
end
# /TEMPORARY
end
4 changes: 4 additions & 0 deletions config/locales/ar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ ar:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/az.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ az:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/be.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ be:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/bg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ bg:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/bn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ bn:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ cs:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/cy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ cy:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/da.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ da:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ de:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/dr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ dr:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ el:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ en:
A: in the <a href="/guidance/download-the-hmrc-app"><abbr title="HM Revenue and Customs">HMRC</abbr> app</a> under 'Your details' or in the 'Self Assessment' section
B: in the <a href="/guidance/download-the-hmrc-app"><abbr title="HM Revenue and Customs">HMRC</abbr> app</a> - watch a <a href="https://www.youtube.com/watch?v=LXw9ily9rTo">video about finding your UTR number in the app</a>
Z: in the <a href="/guidance/download-the-hmrc-app"><abbr title="HM Revenue and Customs">HMRC</abbr> app</a> under 'Your details' or in the 'Self Assessment' section
sa_video_stop_self_employed:
A: <p>You’ll need to provide your <a href="/national-insurance/your-national-insurance-number">National Insurance number</a> and <a href="/find-utr-number">your UTR number</a>.</p>
B: <p>You’ll need to provide your <a href="/national-insurance/your-national-insurance-number">National Insurance number</a> and <a href="/find-utr-number">your UTR number</a>.</p><p><a href="https://www.youtube.com/watch?v=g-CkQRLGb0Q">Watch this video to find out how to tell HMRC you're stopping self-employment</a></p>
Z: <p>You’ll need to provide your <a href="/national-insurance/your-national-insurance-number">National Insurance number</a> and <a href="/find-utr-number">your UTR number</a>.</p>
call_for_evidence:
and: and
another_website_html: This call for evidence %{closed} held on <a href="%{url}">another website</a>
Expand Down
4 changes: 4 additions & 0 deletions config/locales/es-419.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ es-419:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ es:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/et.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ et:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/fa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ fa:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/fi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ fi:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ fr:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/gd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ gd:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/gu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ gu:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/he.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ he:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/hi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ hi:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/hr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ hr:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/hu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ hu:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/hy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ hy:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/id.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ id:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/is.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ is:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ it:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ ja:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/ka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ ka:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/kk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ kk:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
4 changes: 4 additions & 0 deletions config/locales/ko.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ ko:
A:
B:
Z:
sa_video_stop_self_employed:
A:
B:
Z:
call_for_evidence:
and:
another_website_html:
Expand Down
Loading

0 comments on commit e78844a

Please sign in to comment.