From bf497213a8e452c8ca8af7f006a4d2a49d86807b Mon Sep 17 00:00:00 2001 From: Ana Botto Date: Tue, 19 Dec 2023 15:44:19 +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 | 75 ++++++++++ app/views/content_items/guide.html.erb | 2 + config/locales/ar.yml | 16 +++ config/locales/az.yml | 16 +++ config/locales/be.yml | 16 +++ config/locales/bg.yml | 16 +++ config/locales/bn.yml | 16 +++ config/locales/cs.yml | 16 +++ config/locales/cy.yml | 16 +++ config/locales/da.yml | 16 +++ config/locales/de.yml | 16 +++ config/locales/dr.yml | 16 +++ config/locales/el.yml | 16 +++ config/locales/en.yml | 16 +++ config/locales/es-419.yml | 16 +++ config/locales/es.yml | 16 +++ config/locales/et.yml | 16 +++ config/locales/fa.yml | 16 +++ config/locales/fi.yml | 16 +++ config/locales/fr.yml | 16 +++ config/locales/gd.yml | 16 +++ config/locales/gu.yml | 16 +++ config/locales/he.yml | 16 +++ config/locales/hi.yml | 16 +++ config/locales/hr.yml | 16 +++ config/locales/hu.yml | 16 +++ config/locales/hy.yml | 16 +++ config/locales/id.yml | 16 +++ config/locales/is.yml | 16 +++ config/locales/it.yml | 16 +++ config/locales/ja.yml | 16 +++ config/locales/ka.yml | 16 +++ config/locales/kk.yml | 16 +++ config/locales/ko.yml | 16 +++ config/locales/lt.yml | 16 +++ config/locales/lv.yml | 16 +++ config/locales/ms.yml | 16 +++ config/locales/mt.yml | 16 +++ config/locales/ne.yml | 16 +++ config/locales/nl.yml | 16 +++ config/locales/no.yml | 16 +++ config/locales/pa-pk.yml | 16 +++ config/locales/pa.yml | 16 +++ config/locales/pl.yml | 16 +++ config/locales/ps.yml | 16 +++ config/locales/pt.yml | 16 +++ config/locales/ro.yml | 16 +++ config/locales/ru.yml | 16 +++ config/locales/si.yml | 16 +++ config/locales/sk.yml | 16 +++ config/locales/sl.yml | 16 +++ config/locales/so.yml | 16 +++ config/locales/sq.yml | 16 +++ config/locales/sr.yml | 16 +++ config/locales/sv.yml | 16 +++ config/locales/sw.yml | 16 +++ config/locales/ta.yml | 16 +++ config/locales/th.yml | 16 +++ config/locales/tk.yml | 16 +++ config/locales/tr.yml | 16 +++ config/locales/uk.yml | 16 +++ config/locales/ur.yml | 16 +++ config/locales/uz.yml | 16 +++ config/locales/vi.yml | 16 +++ config/locales/yi.yml | 16 +++ config/locales/zh-hk.yml | 16 +++ config/locales/zh-tw.yml | 16 +++ config/locales/zh.yml | 16 +++ .../content_items_controller_test.rb | 135 ++++++++++++++++++ 69 files changed, 1268 insertions(+) diff --git a/app/controllers/content_items_controller.rb b/app/controllers/content_items_controller.rb index 53b26cd89a..272c9a5f74 100644 --- a/app/controllers/content_items_controller.rb +++ b/app/controllers/content_items_controller.rb @@ -25,6 +25,9 @@ def show load_content_item 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? @@ -293,5 +296,77 @@ def temporary_ab_test_find_utr_page @content_item.body.sub!(placeholder, replacement) end end + + 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 + + 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 d851e6caf2..b4ad01ed01 100644 --- a/config/locales/ar.yml +++ b/config/locales/ar.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/az.yml b/config/locales/az.yml index 9a5ae99151..d8f81cd4b9 100644 --- a/config/locales/az.yml +++ b/config/locales/az.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/be.yml b/config/locales/be.yml index c80e7d66f5..d5573a1cd8 100644 --- a/config/locales/be.yml +++ b/config/locales/be.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/bg.yml b/config/locales/bg.yml index ee008c9885..a8fc6ba375 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/bn.yml b/config/locales/bn.yml index 60b51da6b8..bb5426a110 100644 --- a/config/locales/bn.yml +++ b/config/locales/bn.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 0b8661fec2..0629821c23 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/cy.yml b/config/locales/cy.yml index 26a0804bff..db2a694725 100644 --- a/config/locales/cy.yml +++ b/config/locales/cy.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/da.yml b/config/locales/da.yml index 8ba2ab2c03..93aa18df21 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/de.yml b/config/locales/de.yml index 769cbf8d07..dca8be3b58 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/dr.yml b/config/locales/dr.yml index 9296a50978..d2380e3cb9 100644 --- a/config/locales/dr.yml +++ b/config/locales/dr.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/el.yml b/config/locales/el.yml index 730c46a7df..72659eb8cb 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/en.yml b/config/locales/en.yml index b5fc1ecd03..9fb2b6a9fd 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -5,6 +5,22 @@ 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

+ 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..88936ed9e2 100644 --- a/config/locales/es-419.yml +++ b/config/locales/es-419.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/es.yml b/config/locales/es.yml index 5b54053b7b..244ab92bc2 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/et.yml b/config/locales/et.yml index cac6919f16..a23b830870 100644 --- a/config/locales/et.yml +++ b/config/locales/et.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/fa.yml b/config/locales/fa.yml index 3d37eb1494..8accddf576 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/fi.yml b/config/locales/fi.yml index a5b5abc46e..83dfefe8bd 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 78d4580dde..83226ed4ef 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/gd.yml b/config/locales/gd.yml index 72fd6589be..4dc267ec8b 100644 --- a/config/locales/gd.yml +++ b/config/locales/gd.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/gu.yml b/config/locales/gu.yml index dd66768ddd..6960026ca8 100644 --- a/config/locales/gu.yml +++ b/config/locales/gu.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/he.yml b/config/locales/he.yml index 196cd474bd..92e99e9463 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/hi.yml b/config/locales/hi.yml index c110d504be..6cb43e852f 100644 --- a/config/locales/hi.yml +++ b/config/locales/hi.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/hr.yml b/config/locales/hr.yml index b6ac3ab8f0..368409c496 100644 --- a/config/locales/hr.yml +++ b/config/locales/hr.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/hu.yml b/config/locales/hu.yml index da4af534dc..400858b2e7 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/hy.yml b/config/locales/hy.yml index 4badbf87de..f4fdb28806 100644 --- a/config/locales/hy.yml +++ b/config/locales/hy.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/id.yml b/config/locales/id.yml index 80ffe1b2c4..f5d528dc9d 100644 --- a/config/locales/id.yml +++ b/config/locales/id.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/is.yml b/config/locales/is.yml index 7bb4ee5022..dc79881516 100644 --- a/config/locales/is.yml +++ b/config/locales/is.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/it.yml b/config/locales/it.yml index fe6c930d57..0bf253800e 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/ja.yml b/config/locales/ja.yml index aee1ef4578..229d57bcde 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/ka.yml b/config/locales/ka.yml index e9f33e9250..101e29d0c1 100644 --- a/config/locales/ka.yml +++ b/config/locales/ka.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/kk.yml b/config/locales/kk.yml index 555c367dd6..069c055150 100644 --- a/config/locales/kk.yml +++ b/config/locales/kk.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 3932fc3380..c7bcb9a4db 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/lt.yml b/config/locales/lt.yml index 9ccb776c24..8ddec46ae1 100644 --- a/config/locales/lt.yml +++ b/config/locales/lt.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/lv.yml b/config/locales/lv.yml index f898656b8f..2bf6d49a7e 100644 --- a/config/locales/lv.yml +++ b/config/locales/lv.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/ms.yml b/config/locales/ms.yml index 8dddfb0de9..76cad58179 100644 --- a/config/locales/ms.yml +++ b/config/locales/ms.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/mt.yml b/config/locales/mt.yml index 5cf72c8aa5..fcaf4c7117 100644 --- a/config/locales/mt.yml +++ b/config/locales/mt.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/ne.yml b/config/locales/ne.yml index 2a1c858b14..30bf9b00ef 100644 --- a/config/locales/ne.yml +++ b/config/locales/ne.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 938ddce36b..a5ce6f1004 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/no.yml b/config/locales/no.yml index b59e8a0243..b8a4ffa9f7 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/pa-pk.yml b/config/locales/pa-pk.yml index 6b8b9750c3..6f6477d6ed 100644 --- a/config/locales/pa-pk.yml +++ b/config/locales/pa-pk.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/pa.yml b/config/locales/pa.yml index b52fd4f859..16f1b97223 100644 --- a/config/locales/pa.yml +++ b/config/locales/pa.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/pl.yml b/config/locales/pl.yml index d7e9f2efe1..0a8e7ebf18 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/ps.yml b/config/locales/ps.yml index dd21483f60..39b67b4fcc 100644 --- a/config/locales/ps.yml +++ b/config/locales/ps.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/pt.yml b/config/locales/pt.yml index 9fbb83ed8b..2140cf3661 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/ro.yml b/config/locales/ro.yml index b90d644a3b..32ccb109b5 100644 --- a/config/locales/ro.yml +++ b/config/locales/ro.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/ru.yml b/config/locales/ru.yml index ea91a7ccad..fa9573ef13 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/si.yml b/config/locales/si.yml index 3d8ad4a91b..6c9f55d9b6 100644 --- a/config/locales/si.yml +++ b/config/locales/si.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/sk.yml b/config/locales/sk.yml index 6c2241b28e..fb1c0fbcf6 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/sl.yml b/config/locales/sl.yml index 1b70a0439a..e5da7fcd80 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/so.yml b/config/locales/so.yml index 3e38b79002..37ff111189 100644 --- a/config/locales/so.yml +++ b/config/locales/so.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/sq.yml b/config/locales/sq.yml index a6abf3896d..3243ed01e6 100644 --- a/config/locales/sq.yml +++ b/config/locales/sq.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/sr.yml b/config/locales/sr.yml index ddcadc63bc..ba35037f0d 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/sv.yml b/config/locales/sv.yml index 6d06173976..ffb8c9aaf4 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/sw.yml b/config/locales/sw.yml index 846cf4e779..fa1a35b6b4 100644 --- a/config/locales/sw.yml +++ b/config/locales/sw.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/ta.yml b/config/locales/ta.yml index efa6459437..583ca5b3b4 100644 --- a/config/locales/ta.yml +++ b/config/locales/ta.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/th.yml b/config/locales/th.yml index 0d9ff8bb9b..3426e4adb2 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/tk.yml b/config/locales/tk.yml index a12d5200f1..1d23d304ed 100644 --- a/config/locales/tk.yml +++ b/config/locales/tk.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/tr.yml b/config/locales/tr.yml index 3adfc1bce7..fefe830eb8 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/uk.yml b/config/locales/uk.yml index ac5b41a088..7c991d6be1 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/ur.yml b/config/locales/ur.yml index 6f666c36dd..6aed92bcd4 100644 --- a/config/locales/ur.yml +++ b/config/locales/ur.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/uz.yml b/config/locales/uz.yml index 03d286aaa4..1f5b216d4c 100644 --- a/config/locales/uz.yml +++ b/config/locales/uz.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/vi.yml b/config/locales/vi.yml index de499ff1ff..ddde80a1f4 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/yi.yml b/config/locales/yi.yml index 8f7d44c4e5..41c37fa87f 100644 --- a/config/locales/yi.yml +++ b/config/locales/yi.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/zh-hk.yml b/config/locales/zh-hk.yml index 70594fc0f0..a539d62bc0 100644 --- a/config/locales/zh-hk.yml +++ b/config/locales/zh-hk.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/zh-tw.yml b/config/locales/zh-tw.yml index 25446572bb..b1c7d60fbc 100644 --- a/config/locales/zh-tw.yml +++ b/config/locales/zh-tw.yml @@ -5,6 +5,22 @@ 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: + Z: call_for_evidence: and: another_website_html: diff --git a/config/locales/zh.yml b/config/locales/zh.yml index a3082f66b7..39f21744ec 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -5,6 +5,22 @@ 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: + 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..9ab652c75c 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").to_s, 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").to_s, 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").to_s, 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" @@ -409,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").to_s, 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").to_s, 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").to_s, response.body + end + def path_for(content_item, locale = nil) base_path = content_item["base_path"].sub(/^\//, "") base_path.gsub!(/\.#{locale}$/, "") if locale