diff --git a/app/controllers/content_items_controller.rb b/app/controllers/content_items_controller.rb index 53b26cd89a..d908a1eda1 100644 --- a/app/controllers/content_items_controller.rb +++ b/app/controllers/content_items_controller.rb @@ -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? @@ -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 diff --git a/config/locales/ar.yml b/config/locales/ar.yml index d851e6caf2..ef4454c8c9 100644 --- a/config/locales/ar.yml +++ b/config/locales/ar.yml @@ -5,6 +5,10 @@ ar: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/az.yml b/config/locales/az.yml index 9a5ae99151..514b8bc7f8 100644 --- a/config/locales/az.yml +++ b/config/locales/az.yml @@ -5,6 +5,10 @@ az: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/be.yml b/config/locales/be.yml index c80e7d66f5..018292d87a 100644 --- a/config/locales/be.yml +++ b/config/locales/be.yml @@ -5,6 +5,10 @@ be: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/bg.yml b/config/locales/bg.yml index ee008c9885..e6b7e6f660 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -5,6 +5,10 @@ bg: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/bn.yml b/config/locales/bn.yml index 60b51da6b8..a8308ad005 100644 --- a/config/locales/bn.yml +++ b/config/locales/bn.yml @@ -5,6 +5,10 @@ bn: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 0b8661fec2..0bc0940454 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -5,6 +5,10 @@ cs: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/cy.yml b/config/locales/cy.yml index 26a0804bff..b1e28b35a9 100644 --- a/config/locales/cy.yml +++ b/config/locales/cy.yml @@ -5,6 +5,10 @@ cy: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/da.yml b/config/locales/da.yml index 8ba2ab2c03..3f5c40c3dd 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -5,6 +5,10 @@ da: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/de.yml b/config/locales/de.yml index 769cbf8d07..0dcebf3772 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -5,6 +5,10 @@ de: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/dr.yml b/config/locales/dr.yml index 9296a50978..4ca3856a8f 100644 --- a/config/locales/dr.yml +++ b/config/locales/dr.yml @@ -5,6 +5,10 @@ dr: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/el.yml b/config/locales/el.yml index 730c46a7df..c14235a379 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -5,6 +5,10 @@ el: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/en.yml b/config/locales/en.yml index b5fc1ecd03..fad4d5d489 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -5,6 +5,10 @@ en: A: in the HMRC app under 'Your details' or in the 'Self Assessment' section B: in the HMRC app - watch a video about finding your UTR number in the app Z: in the HMRC app under 'Your details' or in the 'Self Assessment' section + sa_video_stop_self_employed: + A:
You’ll need to provide your National Insurance number and your UTR number.
+ B:You’ll need to provide your National Insurance number and your UTR number.
Watch this video to find out how to tell HMRC you're stopping self-employment
+ Z:You’ll need to provide your National Insurance number and your UTR number.
call_for_evidence: and: and another_website_html: This call for evidence %{closed} held on another website diff --git a/config/locales/es-419.yml b/config/locales/es-419.yml index c508978f5a..8d9609e10b 100644 --- a/config/locales/es-419.yml +++ b/config/locales/es-419.yml @@ -5,6 +5,10 @@ es-419: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/es.yml b/config/locales/es.yml index 5b54053b7b..d8c440ac19 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -5,6 +5,10 @@ es: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/et.yml b/config/locales/et.yml index cac6919f16..2f6b40e2e5 100644 --- a/config/locales/et.yml +++ b/config/locales/et.yml @@ -5,6 +5,10 @@ et: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/fa.yml b/config/locales/fa.yml index 3d37eb1494..6d18b345b4 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -5,6 +5,10 @@ fa: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/fi.yml b/config/locales/fi.yml index a5b5abc46e..bb72c6e0e0 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -5,6 +5,10 @@ fi: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 78d4580dde..70114950cc 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -5,6 +5,10 @@ fr: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/gd.yml b/config/locales/gd.yml index 72fd6589be..b195c18a38 100644 --- a/config/locales/gd.yml +++ b/config/locales/gd.yml @@ -5,6 +5,10 @@ gd: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/gu.yml b/config/locales/gu.yml index dd66768ddd..41a809a3bc 100644 --- a/config/locales/gu.yml +++ b/config/locales/gu.yml @@ -5,6 +5,10 @@ gu: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/he.yml b/config/locales/he.yml index 196cd474bd..7632d83a3a 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -5,6 +5,10 @@ he: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/hi.yml b/config/locales/hi.yml index c110d504be..149442c510 100644 --- a/config/locales/hi.yml +++ b/config/locales/hi.yml @@ -5,6 +5,10 @@ hi: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/hr.yml b/config/locales/hr.yml index b6ac3ab8f0..6c3ad37d07 100644 --- a/config/locales/hr.yml +++ b/config/locales/hr.yml @@ -5,6 +5,10 @@ hr: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/hu.yml b/config/locales/hu.yml index da4af534dc..9daedb7c43 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -5,6 +5,10 @@ hu: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/hy.yml b/config/locales/hy.yml index 4badbf87de..c698e3aeb8 100644 --- a/config/locales/hy.yml +++ b/config/locales/hy.yml @@ -5,6 +5,10 @@ hy: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/id.yml b/config/locales/id.yml index 80ffe1b2c4..5533be6cf0 100644 --- a/config/locales/id.yml +++ b/config/locales/id.yml @@ -5,6 +5,10 @@ id: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/is.yml b/config/locales/is.yml index 7bb4ee5022..8f2626600f 100644 --- a/config/locales/is.yml +++ b/config/locales/is.yml @@ -5,6 +5,10 @@ is: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/it.yml b/config/locales/it.yml index fe6c930d57..5fff43e84c 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -5,6 +5,10 @@ it: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/ja.yml b/config/locales/ja.yml index aee1ef4578..85b8d0756a 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -5,6 +5,10 @@ ja: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/ka.yml b/config/locales/ka.yml index e9f33e9250..652434d2ff 100644 --- a/config/locales/ka.yml +++ b/config/locales/ka.yml @@ -5,6 +5,10 @@ ka: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/kk.yml b/config/locales/kk.yml index 555c367dd6..88c41aa9e7 100644 --- a/config/locales/kk.yml +++ b/config/locales/kk.yml @@ -5,6 +5,10 @@ kk: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 3932fc3380..cb5b13b3e0 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -5,6 +5,10 @@ ko: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/lt.yml b/config/locales/lt.yml index 9ccb776c24..1ce3e3bd0f 100644 --- a/config/locales/lt.yml +++ b/config/locales/lt.yml @@ -5,6 +5,10 @@ lt: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/lv.yml b/config/locales/lv.yml index f898656b8f..92c88f6b9f 100644 --- a/config/locales/lv.yml +++ b/config/locales/lv.yml @@ -5,6 +5,10 @@ lv: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/ms.yml b/config/locales/ms.yml index 8dddfb0de9..c539165672 100644 --- a/config/locales/ms.yml +++ b/config/locales/ms.yml @@ -5,6 +5,10 @@ ms: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/mt.yml b/config/locales/mt.yml index 5cf72c8aa5..c76b59dee6 100644 --- a/config/locales/mt.yml +++ b/config/locales/mt.yml @@ -5,6 +5,10 @@ mt: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/ne.yml b/config/locales/ne.yml index 2a1c858b14..a6b8e10ea3 100644 --- a/config/locales/ne.yml +++ b/config/locales/ne.yml @@ -5,6 +5,10 @@ ne: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 938ddce36b..1d23bbba2d 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -5,6 +5,10 @@ nl: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/no.yml b/config/locales/no.yml index b59e8a0243..3764d94b4f 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -5,6 +5,10 @@ A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/pa-pk.yml b/config/locales/pa-pk.yml index 6b8b9750c3..19892fd756 100644 --- a/config/locales/pa-pk.yml +++ b/config/locales/pa-pk.yml @@ -5,6 +5,10 @@ pa-pk: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/pa.yml b/config/locales/pa.yml index b52fd4f859..03c8cfde6e 100644 --- a/config/locales/pa.yml +++ b/config/locales/pa.yml @@ -5,6 +5,10 @@ pa: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/pl.yml b/config/locales/pl.yml index d7e9f2efe1..6d51592d47 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -5,6 +5,10 @@ pl: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/ps.yml b/config/locales/ps.yml index dd21483f60..2c38dd224f 100644 --- a/config/locales/ps.yml +++ b/config/locales/ps.yml @@ -5,6 +5,10 @@ ps: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/pt.yml b/config/locales/pt.yml index 9fbb83ed8b..fbd66c5942 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -5,6 +5,10 @@ pt: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/ro.yml b/config/locales/ro.yml index b90d644a3b..9444b41c35 100644 --- a/config/locales/ro.yml +++ b/config/locales/ro.yml @@ -5,6 +5,10 @@ ro: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/ru.yml b/config/locales/ru.yml index ea91a7ccad..113da9f9f3 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -5,6 +5,10 @@ ru: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/si.yml b/config/locales/si.yml index 3d8ad4a91b..820eb70da2 100644 --- a/config/locales/si.yml +++ b/config/locales/si.yml @@ -5,6 +5,10 @@ si: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/sk.yml b/config/locales/sk.yml index 6c2241b28e..868c6f13cf 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -5,6 +5,10 @@ sk: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/sl.yml b/config/locales/sl.yml index 1b70a0439a..34b70fab56 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -5,6 +5,10 @@ sl: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/so.yml b/config/locales/so.yml index 3e38b79002..18e1a7a149 100644 --- a/config/locales/so.yml +++ b/config/locales/so.yml @@ -5,6 +5,10 @@ so: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/sq.yml b/config/locales/sq.yml index a6abf3896d..7ee1009535 100644 --- a/config/locales/sq.yml +++ b/config/locales/sq.yml @@ -5,6 +5,10 @@ sq: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/sr.yml b/config/locales/sr.yml index ddcadc63bc..a672faddaf 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -5,6 +5,10 @@ sr: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/sv.yml b/config/locales/sv.yml index 6d06173976..a73c578ee1 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -5,6 +5,10 @@ sv: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/sw.yml b/config/locales/sw.yml index 846cf4e779..dbe2e9c1d0 100644 --- a/config/locales/sw.yml +++ b/config/locales/sw.yml @@ -5,6 +5,10 @@ sw: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/ta.yml b/config/locales/ta.yml index efa6459437..f5eb0b3f33 100644 --- a/config/locales/ta.yml +++ b/config/locales/ta.yml @@ -5,6 +5,10 @@ ta: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/th.yml b/config/locales/th.yml index 0d9ff8bb9b..0384e9e21f 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -5,6 +5,10 @@ th: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/tk.yml b/config/locales/tk.yml index a12d5200f1..34df01e85f 100644 --- a/config/locales/tk.yml +++ b/config/locales/tk.yml @@ -5,6 +5,10 @@ tk: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/tr.yml b/config/locales/tr.yml index 3adfc1bce7..37b3539bd7 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -5,6 +5,10 @@ tr: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/uk.yml b/config/locales/uk.yml index ac5b41a088..ab65287118 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -5,6 +5,10 @@ uk: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/ur.yml b/config/locales/ur.yml index 6f666c36dd..f1a9911fda 100644 --- a/config/locales/ur.yml +++ b/config/locales/ur.yml @@ -5,6 +5,10 @@ ur: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/uz.yml b/config/locales/uz.yml index 03d286aaa4..2b7121e960 100644 --- a/config/locales/uz.yml +++ b/config/locales/uz.yml @@ -5,6 +5,10 @@ uz: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/vi.yml b/config/locales/vi.yml index de499ff1ff..2e76784727 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -5,6 +5,10 @@ vi: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/yi.yml b/config/locales/yi.yml index 8f7d44c4e5..f239c94184 100644 --- a/config/locales/yi.yml +++ b/config/locales/yi.yml @@ -5,6 +5,10 @@ yi: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/zh-hk.yml b/config/locales/zh-hk.yml index 70594fc0f0..d13c5dffe1 100644 --- a/config/locales/zh-hk.yml +++ b/config/locales/zh-hk.yml @@ -5,6 +5,10 @@ zh-hk: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/zh-tw.yml b/config/locales/zh-tw.yml index 25446572bb..31ddfab998 100644 --- a/config/locales/zh-tw.yml +++ b/config/locales/zh-tw.yml @@ -5,6 +5,10 @@ zh-tw: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/zh.yml b/config/locales/zh.yml index a3082f66b7..1af6e53b82 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -5,6 +5,10 @@ zh: A: B: Z: + sa_video_stop_self_employed: + A: + B: + Z: call_for_evidence: and: another_website_html: diff --git a/test/controllers/content_items_controller_test.rb b/test/controllers/content_items_controller_test.rb index 5e4c880c5b..ede118f6d7 100644 --- a/test/controllers/content_items_controller_test.rb +++ b/test/controllers/content_items_controller_test.rb @@ -364,6 +364,51 @@ class ContentItemsControllerTest < ActionController::TestCase assert_equal "true", @response.headers[Slimmer::Headers::REMOVE_SEARCH_HEADER] end + test "AB test replaces content on the stop-being-self-employed page with default" do + content_item = content_store_has_schema_example("answer", "answer") + content_item["base_path"] = "/stop-being-self-employed" + content_item["details"]["body"] = "{{ab_test_sa_video_stop_self_employed}}" + + stub_content_store_has_item(content_item["base_path"], content_item) + + request.headers["HTTP_GOVUK_ABTEST_SAVIDEOSTOPSELFEMPLOYED"] = nil + + get :show, params: { path: path_for(content_item) } + assert_response :success + assert_no_match "{{ab_test_sa_video_stop_self_employed}}", response.body + assert_match "#{I18n.t('ab_tests.sa_video_stop_self_employed.Z')}", response.body + end + + test "AB test replaces content on the stop-being-self-employed page with variant A" do + content_item = content_store_has_schema_example("answer", "answer") + content_item["base_path"] = "/stop-being-self-employed" + content_item["details"]["body"] = "{{ab_test_sa_video_stop_self_employed}}" + + stub_content_store_has_item(content_item["base_path"], content_item) + + request.headers["HTTP_GOVUK_ABTEST_SAVIDEOSTOPSELFEMPLOYED"] = "A" + + get :show, params: { path: path_for(content_item) } + assert_response :success + assert_no_match "{{ab_test_sa_video_stop_self_employed}}", response.body + assert_match "#{I18n.t('ab_tests.sa_video_stop_self_employed.A')}", response.body + end + + test "AB test replaces content on the stop-being-self-employed page with variant B" do + content_item = content_store_has_schema_example("answer", "answer") + content_item["base_path"] = "/stop-being-self-employed" + content_item["details"]["body"] = "{{ab_test_sa_video_stop_self_employed}}" + + stub_content_store_has_item(content_item["base_path"], content_item) + + request.headers["HTTP_GOVUK_ABTEST_SAVIDEOSTOPSELFEMPLOYED"] = "B" + + get :show, params: { path: path_for(content_item) } + assert_response :success + assert_no_match "{{ab_test_sa_video_stop_self_employed}}", response.body + assert_match "#{I18n.t('ab_tests.sa_video_stop_self_employed.B')}", response.body + end + test "AB test replaces content on the find-utr-number page with default" do content_item = content_store_has_schema_example("answer", "answer") content_item["base_path"] = "/find-utr-number"