diff --git a/app/helpers/govuk_chat_promo_helper.rb b/app/helpers/govuk_chat_promo_helper.rb deleted file mode 100644 index 4263de42f..000000000 --- a/app/helpers/govuk_chat_promo_helper.rb +++ /dev/null @@ -1,138 +0,0 @@ -module GovukChatPromoHelper - GOVUK_CHAT_PROMO_PATHS = %w[ - /annual-accounts/microentities-small-and-dormant-companies - /become-sole-trader - /become-sole-trader/choose-your-business-name - /become-sole-trader/register-sole-trader - /business-asset-disposal-relief - /business-support-service - /capital-allowances - /capital-allowances/annual-investment-allowance - /capital-allowances/business-cars - /capital-allowances/first-year-allowances - /capital-gains-tax - /capital-gains-tax-businesses - /capital-gains-tax/allowances - /capital-gains-tax/losses - /capital-gains-tax/rates - /child-employment - /child-employment/restrictions-on-child-employment - /closing-a-limited-company - /company-tax-returns - /company-tax-returns/making-changes - /company-tax-returns/penalties-for-late-filing - /contracted-out - /contracted-out/how-contracting-out-affects-your-amount - /corporation-tax - /corporation-tax/work-out-your-corporation-tax - /corporation-tax-rates - /directors-loans/you-owe-your-company-money - /dormant-company/dormant-for-corporation-tax - /employee-tax-codes - /employee-tax-codes/letters - /employers-workplace-pensions-rules - /employment-status/selfemployed-contractor - /eori - /expenses-and-benefits-a-to-z - /expenses-and-benefits-business-travel-mileage/rules-for-tax - /expenses-and-benefits-travel - /flexible-working - /goods-sent-from-abroad - /goods-sent-from-abroad/tax-and-duty - /government/collections/intellectual-property-trade-marks - /government/collections/tax-treaties - /government/publications/strike-off-a-company-from-the-register-ds01 - /government/publications/the-uk-sanctions-list - /guidance/advisory-fuel-rates - /guidance/buildings-and-construction-vat-notice-708 - /guidance/capital-gains-tax-rates-and-allowances - /guidance/corporation-tax-marginal-relief - /guidance/digital-and-online-services - /guidance/expenses-rates-for-employees-travelling-outside-the-uk - /guidance/get-a-certificate-of-residence - /guidance/get-confirmation-from-hmrc-that-you-are-trading-in-the-uk - /guidance/get-your-import-vat-certificates - /guidance/get-your-postponed-import-vat-statement - /guidance/import-of-products-animals-food-and-feed-system - /guidance/rates-and-thresholds-for-employers-2024-to-2025 - /guidance/rates-of-vat-on-different-goods-and-services - /guidance/register-a-trust-as-a-trustee - /guidance/register-or-renew-your-money-laundering-supervision-with-hmrc - /guidance/search-the-companies-house-register - /guidance/send-documents-to-support-declarations-for-the-customs-declaration-service - /guidance/stamp-duty-on-shares - /guidance/tax-free-allowances-on-property-and-trading-income - /guidance/track-a-dbs-application - /guidance/vat-domestic-reverse-charge-for-building-and-construction-services - /guidance/vat-guide-notice-700 - /guidance/vat-place-of-supply-of-services-notice-741a - /guidance/work-out-an-employees-income-tax - /guidance/work-out-an-employees-national-insurance-contributions - /holiday-entitlement-rights - /how-to-register-a-trade-mark - /how-vat-works - /limited-company-formation - /limited-company-formation/choose-company-name - /limited-company-formation/memorandum-and-articles-of-association - /limited-company-formation/register-your-company - /maximum-weekly-working-hours - /pay-corporation-tax - /pay-corporation-tax/approve-a-payment-through-your-online-bank-account - /pay-corporation-tax/bank-details - /pay-corporation-tax/bank-or-building-society - /pay-corporation-tax/check-your-payment-has-been-received - /pay-corporation-tax/debit-or-credit-card - /pay-corporation-tax/direct-debit - /pay-corporation-tax/payments-for-a-group-of-companies - /pay-corporation-tax/tell-hmrc-no-payment-due - /pay-vat - /pay-vat/approve-payment-through-your-online-bank-account - /pay-vat/bank-details - /pay-vat/bank-or-building-society - /pay-vat/by-debit-or-credit-card-online - /pay-vat/direct-debit - /pay-vat/standing-order - /prepare-file-annual-accounts-for-limited-company - /prepare-file-annual-accounts-for-limited-company/file-your-accounts-and-company-tax-return - /register-for-vat - /register-for-vat/cancel-your-registration - /register-for-vat/how-register-for-vat - /rest-breaks-work - /run-business-from-home - /running-a-limited-company - /running-a-limited-company/company-and-accounting-records - /search-bankruptcy-insolvency-register - /search-for-trademark - /self-employed-national-insurance-rates - /set-up-a-social-enterprise - /set-up-business - /set-up-business-partnership - /stamp-duty-land-tax/residential-property-rates - /strike-off-your-company-from-companies-register - /strike-off-your-company-from-companies-register/close-down-your-company - /submit-vat-return - /submit-vat-return/correct-errors-in-your-vat-return - /submit-vat-return/how-to-send-return-pay-vat-bill - /submit-vat-return/interest-underpaid-overpaid-vat - /submit-vat-return/late-returns-and-payment - /submit-vat-return/what-to-include-in-a-vat-return - /tax-employee-share-schemes/share-incentive-plans-sips - /tax-foreign-income - /tax-sell-property - /tax-sell-property/work-out-your-gain - /tax-sell-shares - /tax-sell-shares/work-out-your-gain - /tell-hmrc-changed-business-details - /vat-flat-rate-scheme - /vat-rates - /what-is-the-construction-industry-scheme - /what-you-must-do-as-a-cis-subcontractor/how-to-register - /working-for-yourself - /workplace-pensions - /write-business-plan - ].freeze - - def show_govuk_chat_promo?(path) - ENV["GOVUK_CHAT_PROMO_ENABLED"] == "true" && GOVUK_CHAT_PROMO_PATHS.include?(path) - end -end diff --git a/app/views/shared/_sidebar_navigation.html.erb b/app/views/shared/_sidebar_navigation.html.erb index 89ae0688e..9919b08a0 100644 --- a/app/views/shared/_sidebar_navigation.html.erb +++ b/app/views/shared/_sidebar_navigation.html.erb @@ -1,9 +1,5 @@ <% content_item = @content_item.content_item.parsed_content %>
- <% if show_govuk_chat_promo?(@content_item.requested_path) %> - <%= render "govuk_publishing_components/components/chat_entry", { margin_top_until_tablet: true } %> - <% end %> - <%= render 'govuk_publishing_components/components/contextual_sidebar', content_item: content_item %>
diff --git a/test/helpers/govuk_chat_promo_helper_test.rb b/test/helpers/govuk_chat_promo_helper_test.rb deleted file mode 100644 index beabb3ce3..000000000 --- a/test/helpers/govuk_chat_promo_helper_test.rb +++ /dev/null @@ -1,19 +0,0 @@ -require "test_helper" - -class GovukChatPromoHelperTest < ActionView::TestCase - test "show_govuk_chat_promo? when configuration disabled" do - assert_not show_govuk_chat_promo?(GOVUK_CHAT_PROMO_PATHS.first) - end - - test "show_govuk_chat_promo? when base_path not in configuration" do - ClimateControl.modify GOVUK_CHAT_PROMO_ENABLED: "true" do - assert_not show_govuk_chat_promo?("/non-matching-path") - end - end - - test "show_govuk_chat_promo? when base_path is in configuration" do - ClimateControl.modify GOVUK_CHAT_PROMO_ENABLED: "true" do - assert show_govuk_chat_promo?(GOVUK_CHAT_PROMO_PATHS.first) - end - end -end diff --git a/test/integration/govuk_chat_promo_test.rb b/test/integration/govuk_chat_promo_test.rb deleted file mode 100644 index d1199aa91..000000000 --- a/test/integration/govuk_chat_promo_test.rb +++ /dev/null @@ -1,31 +0,0 @@ -require "test_helper" - -class GovukChatPromoTest < ActionDispatch::IntegrationTest - test "renders GOV.UK chat promo for matching content type and requested path" do - ClimateControl.modify GOVUK_CHAT_PROMO_ENABLED: "true" do - setup_and_visit_a_page_with_specific_base_path("guide", "/contracted-out") - - assert page.has_css?(".gem-c-chat-entry") - end - end - - test "renders GOV.UK chat promo when requested path contains multiple parts" do - ClimateControl.modify GOVUK_CHAT_PROMO_ENABLED: "true" do - setup_and_visit_a_page_with_specific_base_path("guide", "/contracted-out/how-contracting-out-affects-your-amount") - - assert page.has_css?(".gem-c-chat-entry") - end - end - - test "does not render GOV.UK chat promo when base path is in allow list but actual path is not" do - ClimateControl.modify GOVUK_CHAT_PROMO_ENABLED: "true" do - setup_and_visit_a_page_with_specific_base_path("guide", "/contracted-out/check-if-you-were-contracted-out") - - assert_not page.has_css?(".gem-c-chat-entry") - end - end - - def schema_type - "guide" - end -end