From dd16358422743285dd19a34de172dc22bc062329 Mon Sep 17 00:00:00 2001 From: davidtrussler Date: Fri, 22 Dec 2023 12:28:04 +0000 Subject: [PATCH] ACB/DT - Add AB tests to - log-in-file-self-assessment-tax-return - pay-self-assessment-tax-bill/pay-weekly-monthly - stop-being-self-employed --- app/controllers/content_items_controller.rb | 52 ++++++++++- app/views/content_items/guide.html.erb | 2 + config/locales/ar.yml | 12 +++ config/locales/az.yml | 12 +++ config/locales/be.yml | 12 +++ config/locales/bg.yml | 12 +++ config/locales/bn.yml | 12 +++ config/locales/cs.yml | 12 +++ config/locales/cy.yml | 12 +++ config/locales/da.yml | 12 +++ config/locales/de.yml | 12 +++ config/locales/dr.yml | 12 +++ config/locales/el.yml | 12 +++ config/locales/en.yml | 12 +++ config/locales/es-419.yml | 12 +++ config/locales/es.yml | 12 +++ config/locales/et.yml | 12 +++ config/locales/fa.yml | 12 +++ config/locales/fi.yml | 12 +++ config/locales/fr.yml | 12 +++ config/locales/gd.yml | 12 +++ config/locales/gu.yml | 12 +++ config/locales/he.yml | 12 +++ config/locales/hi.yml | 12 +++ config/locales/hr.yml | 12 +++ config/locales/hu.yml | 12 +++ config/locales/hy.yml | 12 +++ config/locales/id.yml | 12 +++ config/locales/is.yml | 12 +++ config/locales/it.yml | 12 +++ config/locales/ja.yml | 12 +++ config/locales/ka.yml | 12 +++ config/locales/kk.yml | 12 +++ config/locales/ko.yml | 12 +++ config/locales/lt.yml | 12 +++ config/locales/lv.yml | 12 +++ config/locales/ms.yml | 12 +++ config/locales/mt.yml | 12 +++ config/locales/ne.yml | 12 +++ config/locales/nl.yml | 12 +++ config/locales/no.yml | 12 +++ config/locales/pa-pk.yml | 12 +++ config/locales/pa.yml | 12 +++ config/locales/pl.yml | 12 +++ config/locales/ps.yml | 12 +++ config/locales/pt.yml | 12 +++ config/locales/ro.yml | 12 +++ config/locales/ru.yml | 12 +++ config/locales/si.yml | 12 +++ config/locales/sk.yml | 12 +++ config/locales/sl.yml | 12 +++ config/locales/so.yml | 12 +++ config/locales/sq.yml | 12 +++ config/locales/sr.yml | 12 +++ config/locales/sv.yml | 12 +++ config/locales/sw.yml | 12 +++ config/locales/ta.yml | 12 +++ config/locales/th.yml | 12 +++ config/locales/tk.yml | 12 +++ config/locales/tr.yml | 12 +++ config/locales/uk.yml | 12 +++ config/locales/ur.yml | 12 +++ config/locales/uz.yml | 12 +++ config/locales/vi.yml | 12 +++ config/locales/yi.yml | 12 +++ config/locales/zh-hk.yml | 12 +++ config/locales/zh-tw.yml | 12 +++ config/locales/zh.yml | 12 +++ .../content_items_controller_test.rb | 90 +++++++++++++++++++ 69 files changed, 934 insertions(+), 2 deletions(-) diff --git a/app/controllers/content_items_controller.rb b/app/controllers/content_items_controller.rb index d908a1eda1..219920760d 100644 --- a/app/controllers/content_items_controller.rb +++ b/app/controllers/content_items_controller.rb @@ -26,6 +26,8 @@ def show temporary_ab_test_find_utr_page temporary_ab_test_stop_self_employed + temporary_ab_test_sa_video_return_1 + temporary_ab_test_sa_video_pay_bill set_expiry if is_service_manual? @@ -294,8 +296,6 @@ def temporary_ab_test_find_utr_page @content_item.body.sub!(placeholder, replacement) end end - # /TEMPORARY - def temporary_ab_test_stop_self_employed placeholder = "{{ab_test_sa_video_stop_self_employed}}" @@ -320,5 +320,53 @@ def temporary_ab_test_stop_self_employed @content_item.body.sub!(placeholder, replacement) end end + + def temporary_ab_test_sa_video_return_1 + placeholder = "{{ab_test_sa_video_return_1}}" + if @content_item.base_path == "/log-in-file-self-assessment-tax-return" && @content_item.body.include?(placeholder) + ab_test = GovukAbTesting::AbTest.new( + "SAVideoReturn1", + dimension: 47, + 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_return_1.A") + when "B" + I18n.t("ab_tests.sa_video_return_1.B") + else + I18n.t("ab_tests.sa_video_return_1.Z") + end + @content_item.body.sub!(placeholder, replacement) + end + end + + def temporary_ab_test_sa_video_pay_bill + placeholder = "{{ab_test_sa_video_pay_bill}}" + if @content_item.base_path == "/pay-self-assessment-tax-bill/pay-weekly-monthly" && @content_item.body.include?(placeholder) + ab_test = GovukAbTesting::AbTest.new( + "SAVideoPayBill", + dimension: 47, + 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_pay_bill.A") + when "B" + I18n.t("ab_tests.sa_video_pay_bill.B") + else + I18n.t("ab_tests.sa_video_pay_bill.Z") + end + @content_item.body.sub!(placeholder, replacement) + end + end # /TEMPORARY end diff --git a/app/views/content_items/guide.html.erb b/app/views/content_items/guide.html.erb index 315d48e397..b1ea2586ee 100644 --- a/app/views/content_items/guide.html.erb +++ b/app/views/content_items/guide.html.erb @@ -152,6 +152,8 @@ <% if ga4_scroll_track_headings_paths.include?(full_url) %> <% end %> + + <%= @requested_variant.analytics_meta_tag.html_safe if @requested_variant.present? %> <% end %> <% unless @content_item.requesting_a_part? %> diff --git a/config/locales/ar.yml b/config/locales/ar.yml index ef4454c8c9..b4ad01ed01 100644 --- a/config/locales/ar.yml +++ b/config/locales/ar.yml @@ -5,6 +5,18 @@ ar: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/az.yml b/config/locales/az.yml index 514b8bc7f8..d8f81cd4b9 100644 --- a/config/locales/az.yml +++ b/config/locales/az.yml @@ -5,6 +5,18 @@ az: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/be.yml b/config/locales/be.yml index 018292d87a..d5573a1cd8 100644 --- a/config/locales/be.yml +++ b/config/locales/be.yml @@ -5,6 +5,18 @@ be: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/bg.yml b/config/locales/bg.yml index e6b7e6f660..a8fc6ba375 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -5,6 +5,18 @@ bg: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/bn.yml b/config/locales/bn.yml index a8308ad005..bb5426a110 100644 --- a/config/locales/bn.yml +++ b/config/locales/bn.yml @@ -5,6 +5,18 @@ bn: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 0bc0940454..0629821c23 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -5,6 +5,18 @@ cs: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/cy.yml b/config/locales/cy.yml index b1e28b35a9..db2a694725 100644 --- a/config/locales/cy.yml +++ b/config/locales/cy.yml @@ -5,6 +5,18 @@ cy: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/da.yml b/config/locales/da.yml index 3f5c40c3dd..93aa18df21 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -5,6 +5,18 @@ da: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/de.yml b/config/locales/de.yml index 0dcebf3772..dca8be3b58 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -5,6 +5,18 @@ de: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/dr.yml b/config/locales/dr.yml index 4ca3856a8f..d2380e3cb9 100644 --- a/config/locales/dr.yml +++ b/config/locales/dr.yml @@ -5,6 +5,18 @@ dr: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/el.yml b/config/locales/el.yml index c14235a379..72659eb8cb 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -5,6 +5,18 @@ el: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/en.yml b/config/locales/en.yml index fad4d5d489..9fb2b6a9fd 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -5,6 +5,18 @@ 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_pay_bill: + A:

Go to your HM Revenue and Customs (HMRC) online account and set up a Direct Debit. Choose the Budget Payment Plan option and follow the instructions to set up your plan.

+ B:

Go to your HM Revenue and Customs (HMRC) online account and set up a Direct Debit. Choose the Budget Payment Plan option and follow the instructions to set up your plan.

Watch this video to find out how a budget payment plan can help you pay your tax bill on time.
+ Z:

Go to your HM Revenue and Customs (HMRC) online account and set up a Direct Debit. Choose the Budget Payment Plan option and follow the instructions to set up your plan.

+ sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: "

You do not have to complete your return in one go. You can save your entry and go back to it later if you need to.

" + B:

You do not have to complete your return in one go. You can save your entry and go back to it later if you need to.

Watch this video to find out more about how to file your tax return.
+ Z: "

You do not have to complete your return in one go. You can save your entry and go back to it later if you need to.

" 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

diff --git a/config/locales/es-419.yml b/config/locales/es-419.yml index 8d9609e10b..88936ed9e2 100644 --- a/config/locales/es-419.yml +++ b/config/locales/es-419.yml @@ -5,6 +5,18 @@ es-419: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/es.yml b/config/locales/es.yml index d8c440ac19..244ab92bc2 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -5,6 +5,18 @@ es: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/et.yml b/config/locales/et.yml index 2f6b40e2e5..a23b830870 100644 --- a/config/locales/et.yml +++ b/config/locales/et.yml @@ -5,6 +5,18 @@ et: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/fa.yml b/config/locales/fa.yml index 6d18b345b4..8accddf576 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -5,6 +5,18 @@ fa: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/fi.yml b/config/locales/fi.yml index bb72c6e0e0..83dfefe8bd 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -5,6 +5,18 @@ fi: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 70114950cc..83226ed4ef 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -5,6 +5,18 @@ fr: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/gd.yml b/config/locales/gd.yml index b195c18a38..4dc267ec8b 100644 --- a/config/locales/gd.yml +++ b/config/locales/gd.yml @@ -5,6 +5,18 @@ gd: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/gu.yml b/config/locales/gu.yml index 41a809a3bc..6960026ca8 100644 --- a/config/locales/gu.yml +++ b/config/locales/gu.yml @@ -5,6 +5,18 @@ gu: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/he.yml b/config/locales/he.yml index 7632d83a3a..92e99e9463 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -5,6 +5,18 @@ he: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/hi.yml b/config/locales/hi.yml index 149442c510..6cb43e852f 100644 --- a/config/locales/hi.yml +++ b/config/locales/hi.yml @@ -5,6 +5,18 @@ hi: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/hr.yml b/config/locales/hr.yml index 6c3ad37d07..368409c496 100644 --- a/config/locales/hr.yml +++ b/config/locales/hr.yml @@ -5,6 +5,18 @@ hr: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/hu.yml b/config/locales/hu.yml index 9daedb7c43..400858b2e7 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -5,6 +5,18 @@ hu: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/hy.yml b/config/locales/hy.yml index c698e3aeb8..f4fdb28806 100644 --- a/config/locales/hy.yml +++ b/config/locales/hy.yml @@ -5,6 +5,18 @@ hy: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/id.yml b/config/locales/id.yml index 5533be6cf0..f5d528dc9d 100644 --- a/config/locales/id.yml +++ b/config/locales/id.yml @@ -5,6 +5,18 @@ id: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/is.yml b/config/locales/is.yml index 8f2626600f..dc79881516 100644 --- a/config/locales/is.yml +++ b/config/locales/is.yml @@ -5,6 +5,18 @@ is: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/it.yml b/config/locales/it.yml index 5fff43e84c..0bf253800e 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -5,6 +5,18 @@ it: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 85b8d0756a..229d57bcde 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -5,6 +5,18 @@ ja: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/ka.yml b/config/locales/ka.yml index 652434d2ff..101e29d0c1 100644 --- a/config/locales/ka.yml +++ b/config/locales/ka.yml @@ -5,6 +5,18 @@ ka: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/kk.yml b/config/locales/kk.yml index 88c41aa9e7..069c055150 100644 --- a/config/locales/kk.yml +++ b/config/locales/kk.yml @@ -5,6 +5,18 @@ kk: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/ko.yml b/config/locales/ko.yml index cb5b13b3e0..c7bcb9a4db 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -5,6 +5,18 @@ ko: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/lt.yml b/config/locales/lt.yml index 1ce3e3bd0f..8ddec46ae1 100644 --- a/config/locales/lt.yml +++ b/config/locales/lt.yml @@ -5,6 +5,18 @@ lt: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/lv.yml b/config/locales/lv.yml index 92c88f6b9f..2bf6d49a7e 100644 --- a/config/locales/lv.yml +++ b/config/locales/lv.yml @@ -5,6 +5,18 @@ lv: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/ms.yml b/config/locales/ms.yml index c539165672..76cad58179 100644 --- a/config/locales/ms.yml +++ b/config/locales/ms.yml @@ -5,6 +5,18 @@ ms: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/mt.yml b/config/locales/mt.yml index c76b59dee6..fcaf4c7117 100644 --- a/config/locales/mt.yml +++ b/config/locales/mt.yml @@ -5,6 +5,18 @@ mt: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/ne.yml b/config/locales/ne.yml index a6b8e10ea3..30bf9b00ef 100644 --- a/config/locales/ne.yml +++ b/config/locales/ne.yml @@ -5,6 +5,18 @@ ne: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 1d23bbba2d..a5ce6f1004 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -5,6 +5,18 @@ nl: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/no.yml b/config/locales/no.yml index 3764d94b4f..b8a4ffa9f7 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -5,6 +5,18 @@ A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/pa-pk.yml b/config/locales/pa-pk.yml index 19892fd756..6f6477d6ed 100644 --- a/config/locales/pa-pk.yml +++ b/config/locales/pa-pk.yml @@ -5,6 +5,18 @@ pa-pk: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/pa.yml b/config/locales/pa.yml index 03c8cfde6e..16f1b97223 100644 --- a/config/locales/pa.yml +++ b/config/locales/pa.yml @@ -5,6 +5,18 @@ pa: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 6d51592d47..0a8e7ebf18 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -5,6 +5,18 @@ pl: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/ps.yml b/config/locales/ps.yml index 2c38dd224f..39b67b4fcc 100644 --- a/config/locales/ps.yml +++ b/config/locales/ps.yml @@ -5,6 +5,18 @@ ps: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/pt.yml b/config/locales/pt.yml index fbd66c5942..2140cf3661 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -5,6 +5,18 @@ pt: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/ro.yml b/config/locales/ro.yml index 9444b41c35..32ccb109b5 100644 --- a/config/locales/ro.yml +++ b/config/locales/ro.yml @@ -5,6 +5,18 @@ ro: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 113da9f9f3..fa9573ef13 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -5,6 +5,18 @@ ru: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/si.yml b/config/locales/si.yml index 820eb70da2..6c9f55d9b6 100644 --- a/config/locales/si.yml +++ b/config/locales/si.yml @@ -5,6 +5,18 @@ si: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/sk.yml b/config/locales/sk.yml index 868c6f13cf..fb1c0fbcf6 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -5,6 +5,18 @@ sk: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/sl.yml b/config/locales/sl.yml index 34b70fab56..e5da7fcd80 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -5,6 +5,18 @@ sl: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/so.yml b/config/locales/so.yml index 18e1a7a149..37ff111189 100644 --- a/config/locales/so.yml +++ b/config/locales/so.yml @@ -5,6 +5,18 @@ so: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/sq.yml b/config/locales/sq.yml index 7ee1009535..3243ed01e6 100644 --- a/config/locales/sq.yml +++ b/config/locales/sq.yml @@ -5,6 +5,18 @@ sq: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/sr.yml b/config/locales/sr.yml index a672faddaf..ba35037f0d 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -5,6 +5,18 @@ sr: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/sv.yml b/config/locales/sv.yml index a73c578ee1..ffb8c9aaf4 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -5,6 +5,18 @@ sv: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/sw.yml b/config/locales/sw.yml index dbe2e9c1d0..fa1a35b6b4 100644 --- a/config/locales/sw.yml +++ b/config/locales/sw.yml @@ -5,6 +5,18 @@ sw: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/ta.yml b/config/locales/ta.yml index f5eb0b3f33..583ca5b3b4 100644 --- a/config/locales/ta.yml +++ b/config/locales/ta.yml @@ -5,6 +5,18 @@ ta: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/th.yml b/config/locales/th.yml index 0384e9e21f..3426e4adb2 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -5,6 +5,18 @@ th: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/tk.yml b/config/locales/tk.yml index 34df01e85f..1d23d304ed 100644 --- a/config/locales/tk.yml +++ b/config/locales/tk.yml @@ -5,6 +5,18 @@ tk: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/tr.yml b/config/locales/tr.yml index 37b3539bd7..fefe830eb8 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -5,6 +5,18 @@ tr: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/uk.yml b/config/locales/uk.yml index ab65287118..7c991d6be1 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -5,6 +5,18 @@ uk: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/ur.yml b/config/locales/ur.yml index f1a9911fda..6aed92bcd4 100644 --- a/config/locales/ur.yml +++ b/config/locales/ur.yml @@ -5,6 +5,18 @@ ur: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/uz.yml b/config/locales/uz.yml index 2b7121e960..1f5b216d4c 100644 --- a/config/locales/uz.yml +++ b/config/locales/uz.yml @@ -5,6 +5,18 @@ uz: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/vi.yml b/config/locales/vi.yml index 2e76784727..ddde80a1f4 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -5,6 +5,18 @@ vi: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/yi.yml b/config/locales/yi.yml index f239c94184..41c37fa87f 100644 --- a/config/locales/yi.yml +++ b/config/locales/yi.yml @@ -5,6 +5,18 @@ yi: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/zh-hk.yml b/config/locales/zh-hk.yml index d13c5dffe1..a539d62bc0 100644 --- a/config/locales/zh-hk.yml +++ b/config/locales/zh-hk.yml @@ -5,6 +5,18 @@ zh-hk: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/zh-tw.yml b/config/locales/zh-tw.yml index 31ddfab998..b1c7d60fbc 100644 --- a/config/locales/zh-tw.yml +++ b/config/locales/zh-tw.yml @@ -5,6 +5,18 @@ zh-tw: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 1af6e53b82..39f21744ec 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -5,6 +5,18 @@ zh: A: B: Z: + sa_video_pay_bill: + A: + B: + Z: + sa_video_ready_reckoner: + A: + B: + Z: + sa_video_return_1: + A: + B: + Z: sa_video_stop_self_employed: A: B: diff --git a/test/controllers/content_items_controller_test.rb b/test/controllers/content_items_controller_test.rb index ede118f6d7..752b943341 100644 --- a/test/controllers/content_items_controller_test.rb +++ b/test/controllers/content_items_controller_test.rb @@ -454,6 +454,96 @@ class ContentItemsControllerTest < ActionController::TestCase assert_match "
  • #{I18n.t('ab_tests.find_utr_number_video_links.B')}
  • ", response.body end +test "AB test replaces content on the log-in-file-self-assessment-tax-return page with default" do + content_item = content_store_has_schema_example("answer", "answer") + content_item["base_path"] = "/log-in-file-self-assessment-tax-return" + content_item["details"]["body"] = "
  • {{ab_test_sa_video_return_1}}
  • " + + stub_content_store_has_item(content_item["base_path"], content_item) + + request.headers["HTTP_GOVUK_ABTEST_SAVIDEORETURN1"] = nil + + get :show, params: { path: path_for(content_item) } + assert_response :success + assert_no_match "{{ab_test_sa_video_return_1}}", response.body + assert_match "
  • #{I18n.t('ab_tests.sa_video_return_1.Z')}
  • ", response.body + end + + test "AB test replaces content on the log-in-file-self-assessment-tax-return page with variant A" do + content_item = content_store_has_schema_example("answer", "answer") + content_item["base_path"] = "/log-in-file-self-assessment-tax-return" + content_item["details"]["body"] = "
  • {{ab_test_sa_video_return_1}}
  • " + + stub_content_store_has_item(content_item["base_path"], content_item) + + request.headers["HTTP_GOVUK_ABTEST_SAVIDEORETURN1"] = "A" + + get :show, params: { path: path_for(content_item) } + assert_response :success + assert_no_match "{{ab_test_sa_video_return_1}}", response.body + assert_match "
  • #{I18n.t('ab_tests.sa_video_return_1.A')}
  • ", response.body + end + + test "AB test replaces content on the log-in-file-self-assessment-tax-return page with variant B" do + content_item = content_store_has_schema_example("answer", "answer") + content_item["base_path"] = "/log-in-file-self-assessment-tax-return" + content_item["details"]["body"] = "
  • {{ab_test_sa_video_return_1}}
  • " + + stub_content_store_has_item(content_item["base_path"], content_item) + + request.headers["HTTP_GOVUK_ABTEST_SAVIDEORETURN1"] = "B" + + get :show, params: { path: path_for(content_item) } + assert_response :success + assert_no_match "{{ab_test_sa_video_return_1}}", response.body + assert_match "
  • #{I18n.t('ab_tests.sa_video_return_1.B')}
  • ", response.body + end + + test "AB test replaces content on the pay-weekly-monthly page with default" do + content_item = content_store_has_schema_example("answer", "answer") + content_item["base_path"] = "/pay-self-assessment-tax-bill/pay-weekly-monthly" + content_item["details"]["body"] = "{{ab_test_sa_video_pay_bill}}" + + stub_content_store_has_item(content_item["base_path"], content_item) + + request.headers["HTTP_GOVUK_ABTEST_SAVIDEOPAYBILL"] = nil + + get :show, params: { path: path_for(content_item) } + assert_response :success + assert_no_match "{{ab_test_sa_video_pay_bill}}", response.body + assert_match "#{I18n.t('ab_tests.sa_video_pay_bill.Z')}", response.body + end + + test "AB test replaces content on the pay-weekly-monthly page with Variant A" do + content_item = content_store_has_schema_example("answer", "answer") + content_item["base_path"] = "/pay-self-assessment-tax-bill/pay-weekly-monthly" + content_item["details"]["body"] = "{{ab_test_sa_video_pay_bill}}" + + stub_content_store_has_item(content_item["base_path"], content_item) + + request.headers["HTTP_GOVUK_ABTEST_SAVIDEOPAYBILL"] = "A" + + get :show, params: { path: path_for(content_item) } + assert_response :success + assert_no_match "{{ab_test_sa_video_pay_bill}}", response.body + assert_match "#{I18n.t('ab_tests.sa_video_pay_bill.A')}", response.body + end + + test "AB test replaces content on the pay-weekly-monthly page with Variant B" do + content_item = content_store_has_schema_example("answer", "answer") + content_item["base_path"] = "/pay-self-assessment-tax-bill/pay-weekly-monthly" + content_item["details"]["body"] = "{{ab_test_sa_video_pay_bill}}" + + stub_content_store_has_item(content_item["base_path"], content_item) + + request.headers["HTTP_GOVUK_ABTEST_SAVIDEOPAYBILL"] = "B" + + get :show, params: { path: path_for(content_item) } + assert_response :success + assert_no_match "{{ab_test_sa_video_pay_bill}}", response.body + assert_match "#{I18n.t('ab_tests.sa_video_pay_bill.B')}", response.body + end + def path_for(content_item, locale = nil) base_path = content_item["base_path"].sub(/^\//, "") base_path.gsub!(/\.#{locale}$/, "") if locale