From ab8a1f67882644d99c70ba21fb0b9957d915f97d Mon Sep 17 00:00:00 2001 From: Jessica Jones Date: Wed, 11 Dec 2024 14:14:35 +0000 Subject: [PATCH] Remove intergration test for the UR banner This test will fail once we pass the expiration date of the banner in the gem. We could add a setup and tear down to set the time to be within the banner start and end date, but this will only result in apassing test whilst the config remains in the gem. If someone removes the config from the gem (clearing up after the banner has expired) and forgets to remove this test, then deploys of this application would be blocked. This seems bad, and somewhat defeats the purpose of having the code in a gem. --- test/integration/recruitment_banner_test.rb | 63 --------------------- 1 file changed, 63 deletions(-) delete mode 100644 test/integration/recruitment_banner_test.rb diff --git a/test/integration/recruitment_banner_test.rb b/test/integration/recruitment_banner_test.rb deleted file mode 100644 index 4abf5d87b..000000000 --- a/test/integration/recruitment_banner_test.rb +++ /dev/null @@ -1,63 +0,0 @@ -require "test_helper" - -class RecruitmentBannerTest < ActionDispatch::IntegrationTest - test "AI banner 11/11/2024 is displayed on guides of interest" do - guide_paths = [ - "/self-assessment-tax-returns", - "/self-employed-records", - "/expenses-if-youre-self-employed", - "/first-company-accounts-and-return", - "/capital-allowances", - "/simpler-income-tax-cash-basis", - "/capital-gains-tax", - "/directors-loans", - "/running-a-limited-company", - "/introduction-to-business-rates", - "/apply-for-business-rate-relief", - "/tax-codes", - ] - - content_item = GovukSchemas::Example.find("guide", example_name: "guide") - - guide_paths.each do |path| - content_item["base_path"] = path - stub_content_store_has_item(content_item["base_path"], content_item.to_json) - visit content_item["base_path"] - - assert page.has_css?(".gem-c-intervention") - assert page.has_link?("Sign up to take part in user research (opens in a new tab)", href: "https://survey.take-part-in-research.service.gov.uk/jfe/form/SV_2bggmg6xlelrO0S") - end - end - - test "AI banner 11/11/2024 is displayed on answers of interest" do - answer_paths = [ - "/working-for-yourself", - "/what-is-the-construction-industry-scheme", - "/expenses-and-benefits-a-to-z", - "/self-assessment-tax-return-forms", - "/calculate-tax-on-company-cars", - "/calculate-your-business-rates", - "/stop-being-self-employed", - ] - - content_item = GovukSchemas::Example.find("answer", example_name: "answer") - - answer_paths.each do |path| - content_item["base_path"] = path - stub_content_store_has_item(content_item["base_path"], content_item.to_json) - visit content_item["base_path"] - - assert page.has_css?(".gem-c-intervention") - assert page.has_link?("Sign up to take part in user research (opens in a new tab)", href: "https://survey.take-part-in-research.service.gov.uk/jfe/form/SV_2bggmg6xlelrO0S") - end - end - - test "AI banner 11/11/2024 is not displayed on all pages" do - detailed_guide = GovukSchemas::Example.find("detailed_guide", example_name: "detailed_guide") - detailed_guide["base_path"] = "/nothing-to-see-here" - stub_content_store_has_item(detailed_guide["base_path"], detailed_guide.to_json) - visit detailed_guide["base_path"] - - assert_not page.has_css?(".gem-c-intervention") - end -end