From 225efd932381dac9fbad82ca9a3137ba673e8f17 Mon Sep 17 00:00:00 2001 From: Rachel Smith Date: Fri, 23 Mar 2018 16:51:24 +0000 Subject: [PATCH 1/2] HUB-90 - https://govukverify.atlassian.net/browse/HUB-90 - Remove verify trial create account page as the double col layout view has been deemed unsucessful. This undoes the changes made in HUB-39 https://govukverify.atlassian.net/browse/HUB-39 and should revert the page views for the create account pages for the company car tax, personal tax and income tax services to display the content from publisher again. Solo: @rachelthecodesmith --- .../choose_sign_in_presenter.rb | 4 - .../create_new_account_presenter.rb | 4 - ..._hub_trial_create_new_account_presenter.rb | 60 ------------ app/services/presenter_builder.rb | 14 +-- .../content_items/service_sign_in.html.erb | 2 +- ...rify_hub_trial_create_new_account.html.erb | 98 ------------------- ...erify_hub_trial_create_new_account_test.rb | 74 -------------- ...trial_create_new_account_presenter_test.rb | 90 ----------------- 8 files changed, 2 insertions(+), 344 deletions(-) delete mode 100644 app/presenters/service_sign_in/verify_hub_trial_create_new_account_presenter.rb delete mode 100644 app/views/content_items/service_sign_in/_verify_hub_trial_create_new_account.html.erb delete mode 100644 test/integration/service_sign_in/verify_hub_trial_create_new_account_test.rb delete mode 100644 test/presenters/service_sign_in/verify_hub_trial_create_new_account_presenter_test.rb diff --git a/app/presenters/service_sign_in/choose_sign_in_presenter.rb b/app/presenters/service_sign_in/choose_sign_in_presenter.rb index b7fbef6fe..1b07d832c 100644 --- a/app/presenters/service_sign_in/choose_sign_in_presenter.rb +++ b/app/presenters/service_sign_in/choose_sign_in_presenter.rb @@ -6,10 +6,6 @@ def page_type "choose_sign_in" end - def partial_type - "choose_sign_in" - end - def title choose_sign_in["title"] end diff --git a/app/presenters/service_sign_in/create_new_account_presenter.rb b/app/presenters/service_sign_in/create_new_account_presenter.rb index dfb5ecb29..09abd46d7 100644 --- a/app/presenters/service_sign_in/create_new_account_presenter.rb +++ b/app/presenters/service_sign_in/create_new_account_presenter.rb @@ -6,10 +6,6 @@ def page_type "create_new_account" end - def partial_type - "create_new_account" - end - def title create_new_account["title"] end diff --git a/app/presenters/service_sign_in/verify_hub_trial_create_new_account_presenter.rb b/app/presenters/service_sign_in/verify_hub_trial_create_new_account_presenter.rb deleted file mode 100644 index 351a81b6f..000000000 --- a/app/presenters/service_sign_in/verify_hub_trial_create_new_account_presenter.rb +++ /dev/null @@ -1,60 +0,0 @@ -# Trial new start page payout for update company car details and income tax services (by verify hub improvements team) -# Due for teardown/review on 23rd March 2018 - Jira card HUB-39 - -module ServiceSignIn - class VerifyHubTrialCreateNewAccountPresenter < ContentItemPresenter - include ServiceSignIn::Paths - - GOV_GATE_URL_FOR_COMPANY_CAR = "https://www.tax.service.gov.uk/paye/company-car/start-government-gateway".freeze - GOV_GATE_URL_FOR_INCOME_TAX = "https://www.tax.service.gov.uk/check-income-tax/start-government-gateway?_ga=2.114080007.145612230.1512381177-373904926.147".freeze - GOV_GATE_URL_FOR_PERSONAL_TAX = "https://www.tax.service.gov.uk/personal-account/start-government-gateway".freeze - VERIFY_URL_FOR_COMPANY_CAR = "https://www.tax.service.gov.uk/paye/company-car/start-verify".freeze - VERIFY_URL_FOR_INCOME_TAX = "https://www.tax.service.gov.uk/check-income-tax/start-verify?_ga=2.114080007.145612230.1512381177-373904926.1473694521".freeze - VERIFY_URL_FOR_PERSONAL_TAX = "https://www.tax.service.gov.uk/personal-account/start-verify".freeze - - - SERVICE_TEXT_FOR_COMPANY_CAR = "check or update your company car tax".freeze - SERVICE_TEXT_FOR_INCOME_TAX = "check your income tax for the current year".freeze - SERVICE_TEXT_FOR_PERSONAL_TAX = "access your personal tax account".freeze - - def page_type - "create_new_account" - end - - def partial_type - "verify_hub_trial_create_new_account" - end - - def service_specific_text - return SERVICE_TEXT_FOR_COMPANY_CAR if content_item['base_path'].include?("update-company-car-details") - return SERVICE_TEXT_FOR_INCOME_TAX if content_item['base_path'].include?("check-income-tax-current-year") - return SERVICE_TEXT_FOR_PERSONAL_TAX if content_item['base_path'].include?("personal-tax-account") - end - - def govenment_gateway_url - return GOV_GATE_URL_FOR_COMPANY_CAR if content_item['base_path'].include?("update-company-car-details") - return GOV_GATE_URL_FOR_INCOME_TAX if content_item['base_path'].include?("check-income-tax-current-year") - return GOV_GATE_URL_FOR_PERSONAL_TAX if content_item['base_path'].include?("personal-tax-account") - end - - def verify_url - return VERIFY_URL_FOR_COMPANY_CAR if content_item['base_path'].include?("update-company-car-details") - return VERIFY_URL_FOR_INCOME_TAX if content_item['base_path'].include?("check-income-tax-current-year") - return VERIFY_URL_FOR_PERSONAL_TAX if content_item['base_path'].include?("personal-tax-account") - end - - def back_link - "#{content_item['base_path']}/#{parent_slug}" - end - - private - - def parent_slug - content_item["details"]["choose_sign_in"]["slug"] - end - - def create_new_account - content_item["details"]["create_new_account"] - end - end -end diff --git a/app/services/presenter_builder.rb b/app/services/presenter_builder.rb index 758a81950..0423bb081 100644 --- a/app/services/presenter_builder.rb +++ b/app/services/presenter_builder.rb @@ -36,25 +36,13 @@ def service_sign_in_format? end def service_sign_in_presenter_name - if new_create_account_page? - "ServiceSignIn::VerifyHubTrialCreateNewAccountPresenter" - elsif content_path_create_account? + if content_path_create_account? "ServiceSignIn::CreateNewAccountPresenter" else "ServiceSignIn::ChooseSignInPresenter" end end - def new_create_account_page? - content_path_create_account? && service_included_for_trial? - end - - def service_included_for_trial? - content_item_path.include?("update-company-car-details") || - content_item_path.include?("check-income-tax-current-year") || - content_item_path.include?("personal-tax-account") - end - def content_path_create_account? slug = content_item_path.split("/").last content_item.dig("details", "create_new_account", "slug") == slug diff --git a/app/views/content_items/service_sign_in.html.erb b/app/views/content_items/service_sign_in.html.erb index a67fd91f3..d8ba32b04 100644 --- a/app/views/content_items/service_sign_in.html.erb +++ b/app/views/content_items/service_sign_in.html.erb @@ -5,4 +5,4 @@ <% end %> -<%= render partial: "content_items/service_sign_in/#{@content_item.partial_type}" %> +<%= render partial: "content_items/service_sign_in/#{@content_item.page_type}" %> diff --git a/app/views/content_items/service_sign_in/_verify_hub_trial_create_new_account.html.erb b/app/views/content_items/service_sign_in/_verify_hub_trial_create_new_account.html.erb deleted file mode 100644 index 0c28662af..000000000 --- a/app/views/content_items/service_sign_in/_verify_hub_trial_create_new_account.html.erb +++ /dev/null @@ -1,98 +0,0 @@ -<%= render "govuk_publishing_components/components/back_link", href: @content_item.back_link %> - -<%= render "components/heading", { - text: "Create an account", - heading_level: 1 -} %> - -
-
-
-

You can choose to use Government Gateway or GOV.UK Verify. You'll be able to <%=@content_item.service_specific_text%> with either.

-
-
-
- -
-
-

Government Gateway

-
- -

What you need

- -

Government Gateway works best if you have:

- -
    -
  • your National Insurance number
  • -
- -

And one of the following:

- -
    -
  • a P60
  • -
  • a recent payslip
  • -
  • a UK passport
  • -
- <%= render 'govuk_component/button', - text: 'Create a Government Gateway account', - href: @content_item.govenment_gateway_url, - margin_bottom: true, - rel: "external" - %> -
-

How long it takes, on average

-

10 minutes

-
-

How it works

- -

Your details will be shared with the department that runs the '<%=@content_item.service_specific_text%>' service.

-
- -
-

GOV.UK Verify

-
-

What you need

-

GOV.UK Verify requires you to:

- -
    -
  • have a UK address
  • -
  • be over 18 years old
  • -
- -

It works best if you can provide either:

- -
    -
  • a valid passport
  • -
  • a driving licence
  • -
- <%= render 'govuk_component/button', - text: 'Create an account with GOV.UK Verify', - href: @content_item.verify_url, - margin_bottom: true, - rel: "external" - %> -
-

How long it takes, on average

- -

15 minutes

-
-

How it works

- -

A certified company with double check your identity. All companies involved have met security standards set by government

-
- -
-
-
- -
-
-

Personal tax account

- -

- Signing in for the first time will activate your personal tax account. You can use this to check your HMRC records and manage your other details. -

-
-
- - diff --git a/test/integration/service_sign_in/verify_hub_trial_create_new_account_test.rb b/test/integration/service_sign_in/verify_hub_trial_create_new_account_test.rb deleted file mode 100644 index d15d01bf5..000000000 --- a/test/integration/service_sign_in/verify_hub_trial_create_new_account_test.rb +++ /dev/null @@ -1,74 +0,0 @@ -require 'test_helper' - -module ServiceSignIn - class VerifyHubTrialCreateNewAccount < ActionDispatch::IntegrationTest - test "random but valid items do not error" do - # Create new account is an optional field, so we need to try a few times to - # get an example with it present. - path = nil - until path - payload = GovukSchemas::RandomExample.for_schema(frontend_schema: schema_type) - path = payload.dig("details", "create_new_account", "slug") - end - - stub_request(:get, %r{#{path}}) - .to_return(status: 200, body: payload.to_json, headers: {}) - - visit path - end - - test "page renders correctly for company car details" do - SERVICE_TEXT_FOR_COMPANY_CAR = "check or update your company car tax".freeze - setup_and_visit_create_new_account_page("/update-company-car-details/sign-in") - assert page.has_text?('Create an account') - assert page.has_text?(SERVICE_TEXT_FOR_COMPANY_CAR) - assert page.has_text?("You can choose to use Government Gateway or GOV.UK Verify.") - assert page.has_css?(shared_component_selector('button'), text: "Create a Government Gateway account") - assert page.has_css?(shared_component_selector('button'), text: "Create an account with GOV.UK Verify") - assert page.has_css?('meta[name="robots"][content="noindex, nofollow"]', visible: false) - assert page.has_css?('.gem-c-back-link[href="/update-company-car-details/sign-in/choose-sign-in"]', text: 'Back') - end - - test "page renders correctly for income tax details" do - SERVICE_TEXT_FOR_INCOME_TAX = "check your income tax for the current year".freeze - setup_and_visit_create_new_account_page("/check-income-tax-current-year/sign-in") - assert page.has_text?('Create an account') - assert page.has_text?(SERVICE_TEXT_FOR_INCOME_TAX) - assert page.has_text?("You can choose to use Government Gateway or GOV.UK Verify.") - assert page.has_css?(shared_component_selector('button'), text: "Create a Government Gateway account") - assert page.has_css?(shared_component_selector('button'), text: "Create an account with GOV.UK Verify") - assert page.has_css?('meta[name="robots"][content="noindex, nofollow"]', visible: false) - assert page.has_css?('.gem-c-back-link[href="/check-income-tax-current-year/sign-in/choose-sign-in"]', text: 'Back') - end - - test "page renders correctly for self_assessment" do - setup_and_visit_create_new_account_page("/log-in-file-self-assessment-tax-return/sign-in") - assert page.has_css?("title", text: 'Create an account - GOV.UK', visible: false) - within shared_component_selector('title') do - assert page.has_text?("Create an account") - end - - assert_has_component_govspeak("

To use this service, you need to create either a Government Gateway or GOV.UK Verify account. These are used to help fight identity theft.

Once you have an account, you can use it to access other government services online.

Choose a way to prove your identity

Government Gateway

Registering with Government Gateway usually takes about 10 minutes. It works best if you have:

Create a Government Gateway account.

GOV.UK Verify

Registering with GOV.UK Verify usually takes about 15 minutes. It works best if you have:

Create a GOV.UK Verify account.

A certified company will double check your identity when you register with GOV.UK Verify. They’ve all met security standards set by government.

Personal tax account

Signing in for the first time will activate your personal tax account. You can use this to check your HMRC records and manage your other details.

") - - assert page.has_css?('meta[name="robots"][content="noindex, nofollow"]', visible: false) - refute page.has_css?(shared_component_selector('government_navigation')) - - assert page.has_css?( - '.gem-c-back-link[href="/log-in-file-self-assessment-tax-return/sign-in/choose-sign-in"]', - text: 'Back' - ) - end - - def setup_and_visit_create_new_account_page(service_base_path) - content_item = get_content_example("service_sign_in") - content_item["base_path"] = service_base_path - path = content_item["base_path"] + "/create-new-account" - content_store_has_item(path, content_item.to_json) - visit(path) - end - - def schema_type - "service_sign_in" - end - end -end diff --git a/test/presenters/service_sign_in/verify_hub_trial_create_new_account_presenter_test.rb b/test/presenters/service_sign_in/verify_hub_trial_create_new_account_presenter_test.rb deleted file mode 100644 index 369d39f84..000000000 --- a/test/presenters/service_sign_in/verify_hub_trial_create_new_account_presenter_test.rb +++ /dev/null @@ -1,90 +0,0 @@ -require 'test_helper' - -class ServiceSignInPresenterTest - class VerifyHubTrialCreateNewAccount < ActiveSupport::TestCase - GOV_GATE_URL_FOR_COMPANY_CAR = "https://www.tax.service.gov.uk/paye/company-car/start-government-gateway".freeze - GOV_GATE_URL_FOR_INCOME_TAX = "https://www.tax.service.gov.uk/check-income-tax/start-government-gateway?_ga=2.114080007.145612230.1512381177-373904926.147".freeze - GOV_GATE_URL_FOR_PERSONAL_TAX = "https://www.tax.service.gov.uk/personal-account/start-government-gateway".freeze - VERIFY_URL_FOR_COMPANY_CAR = "https://www.tax.service.gov.uk/paye/company-car/start-verify".freeze - VERIFY_URL_FOR_INCOME_TAX = "https://www.tax.service.gov.uk/check-income-tax/start-verify?_ga=2.114080007.145612230.1512381177-373904926.1473694521".freeze - VERIFY_URL_FOR_PERSONAL_TAX = "https://www.tax.service.gov.uk/personal-account/start-verify".freeze - - SERVICE_TEXT_FOR_COMPANY_CAR = "check or update your company car tax".freeze - SERVICE_TEXT_FOR_INCOME_TAX = "check your income tax for the current year".freeze - SERVICE_TEXT_FOR_PERSONAL_TAX = "access your personal tax account".freeze - - def schema_name - "service_sign_in" - end - - def setup - @presented_item = present_example(schema_item) - @create_new_account = schema_item["details"]["create_new_account"] - end - - def present_example(example) - ServiceSignIn::VerifyHubTrialCreateNewAccountPresenter.new(example) - end - - def schema_item - @schema_item ||= govuk_content_schema_example(schema_name, schema_name) - end - - def parent_slug - schema_item['details']['choose_sign_in']['slug'] - end - - test 'presents the schema_name' do - assert_equal schema_item['schema_name'], @presented_item.schema_name - end - - test 'presents correct url for gateway sign up - update company car details' do - schema_item['base_path'] = "update-company-car-details/sign-in" - assert_equal GOV_GATE_URL_FOR_COMPANY_CAR, @presented_item.govenment_gateway_url - end - - test 'presents correct url for verify sign up - update company car details' do - schema_item['base_path'] = "update-company-car-details/sign-in" - assert_equal VERIFY_URL_FOR_COMPANY_CAR, @presented_item.verify_url - end - - test 'presents correct url for gateway sign up - check income tax' do - schema_item['base_path'] = "check-income-tax-current-year/sign-in" - assert_equal GOV_GATE_URL_FOR_INCOME_TAX, @presented_item.govenment_gateway_url - end - - test 'presents correct url for verify sign up - check income tax' do - schema_item['base_path'] = "check-income-tax-current-year/sign-in" - assert_equal VERIFY_URL_FOR_INCOME_TAX, @presented_item.verify_url - end - - test 'presents correct url for gateway sign up - personal tax account' do - schema_item['base_path'] = "personal-tax-account/sign-in" - assert_equal GOV_GATE_URL_FOR_PERSONAL_TAX, @presented_item.govenment_gateway_url - end - - test 'presents correct url for verify sign up - personal tax account' do - schema_item['base_path'] = "personal-tax-account/sign-in" - assert_equal VERIFY_URL_FOR_PERSONAL_TAX, @presented_item.verify_url - end - - test 'presents correct service text - update company car details' do - schema_item['base_path'] = "update-company-car-details/sign-in" - assert_equal SERVICE_TEXT_FOR_COMPANY_CAR, @presented_item.service_specific_text - end - - test 'presents correct service text - check income tax' do - schema_item['base_path'] = "check-income-tax-current-year/sign-in" - assert_equal SERVICE_TEXT_FOR_INCOME_TAX, @presented_item.service_specific_text - end - - test 'presents correct service text - personal tax account' do - schema_item['base_path'] = "personal-tax-account/sign-in" - assert_equal SERVICE_TEXT_FOR_PERSONAL_TAX, @presented_item.service_specific_text - end - - test 'presents the back_link' do - assert_equal "#{schema_item['base_path']}/#{parent_slug}", @presented_item.back_link - end - end -end From 77d22a94d47364879a47eee2fc61f3e65e5e3398 Mon Sep 17 00:00:00 2001 From: Rachel Smith Date: Wed, 28 Mar 2018 15:46:03 +0100 Subject: [PATCH 2/2] HUB-90: Removed redundant style sheet @rachelthecodesmith --- app/assets/stylesheets/application.scss | 1 - .../stylesheets/views/_service_sign_in.scss | 37 ------------------- 2 files changed, 38 deletions(-) delete mode 100644 app/assets/stylesheets/views/_service_sign_in.scss diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index f6bea3122..f9643040a 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -49,4 +49,3 @@ @import 'views/answer'; @import 'views/help-page'; @import "views/guide"; -@import "views/service_sign_in"; diff --git a/app/assets/stylesheets/views/_service_sign_in.scss b/app/assets/stylesheets/views/_service_sign_in.scss deleted file mode 100644 index 2faa50f56..000000000 --- a/app/assets/stylesheets/views/_service_sign_in.scss +++ /dev/null @@ -1,37 +0,0 @@ -@import "grid_layout"; - -.service-sign-in { - .column-one-half { @include grid-column(1 / 2); }; - .column-two-thirds { @include grid-column(2 / 3); }; - .column-full { @include grid-column(1); }; - - h3 { - @include bold-24; - margin-bottom: 4px; - } - - hr { - margin-top: 5px; - margin-bottom: 5px; - } - - a { - text-decoration: underline; - } - - .gem-c-back-link { - text-decoration: none; - } - - .pub-c-button { - text-decoration: none; - } - - .fixed-height { - height: 40px; - - @include media(mobile) { - height: auto; - } - } -}