Skip to content

Commit

Permalink
Change login page title when One Login is active
Browse files Browse the repository at this point in the history
  • Loading branch information
elceebee committed Jan 21, 2025
1 parent 7aeb048 commit 2b2dd3c
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<% content_for :title, title_with_error_prefix(t('page_titles.create_account_or_sign_in'), @create_account_or_sign_in_form.errors.any?) %>
<% title = FeatureFlag.active?(:one_login_candidate_sign_in) ? t('page_titles.create_a_gov_uk_one_login_or_sign_in') : t('page_titles.create_account_or_sign_in') %>
<% content_for :title, title_with_error_prefix(title, @create_account_or_sign_in_form.errors.any?) %>

<%= render ServiceInformationBanner.new(namespace: :candidate) %>

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= render CandidateInterface::OneLoginPreReleaseSignInBannerComponent.new %>

<h1 class="govuk-heading-xl">
<%= t('page_titles.create_account_or_sign_in') %>
</h1>

<% if FeatureFlag.active?(:one_login_candidate_sign_in) %>

<h1 class="govuk-heading-xl">
<%= title %>
</h1>

<p class="govuk-body">
<%= t('govuk.one_login_account_guidance') %>
</p>
Expand All @@ -24,6 +26,10 @@
) do |f| %>
<%= f.govuk_error_summary %>

<h1 class="govuk-heading-xl">
<%= title %>
</h1>

<%= f.govuk_radio_buttons_fieldset :existing_account, legend: { text: 'Do you already have an account?' } do %>
<%= f.govuk_radio_button :existing_account, true, label: { text: 'Yes, sign in' }, link_errors: true do %>
<%= f.govuk_email_field :email, label: { text: 'Email address', size: 's' }, hint: { text: 'Enter the email address you used to register, and we will send you a link to sign in.' }, width: 'two-thirds', autocomplete: 'email', spellcheck: false %>
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ en:
unsubmitted_previous_application: Your previously unsubmitted application
submitted_application: Your submitted application
create_account_or_sign_in: Create an account or sign in
create_a_gov_uk_one_login_or_sign_in: Create a GOV.UK One Login or sign in
sign_up: Create an account
sign_in: Sign in
email_address_not_recognised: Your email address is not recognised
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/jmeter.rake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def generate_plan(host:, thread_count:, token:)
end

visit name: 'GET candidate account page', url: "#{host}/candidate/account" do
assert contains: 'Create an account or sign in'
assert contains: FeatureFlag.active?(:one_login_candidate_sign_in) ? 'Create a GOV.UK One Login or sign in' : 'Create an account or sign in'
end

header name: 'COOKIE', value: "_apply_for_postgraduate_teacher_training_session=#{token}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rails_helper'

RSpec.describe 'Candidate viewing booked interviews' do
RSpec.describe 'Candidate session timeout' do
include CandidateHelper
include ActiveSupport::Testing::TimeHelpers

Expand Down Expand Up @@ -47,7 +47,7 @@ def then_i_see_my_details
end

def then_i_see_the_login_page
expect(page).to have_content 'Create an account or sign in'
expect(page).to have_content 'Create a GOV.UK One Login or sign in'
end

private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def then_i_see_my_applications
end

def then_i_am_logged_out
expect(page).to have_title 'Create an account or sign in'
expect(page).to have_title 'Create a GOV.UK One Login or sign in'
expect(page).to have_content 'You need a GOV.UK One Login to sign in to this service. You can create one if you do not already have one.'
expect(page).to have_current_path candidate_interface_create_account_or_sign_in_path
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
RSpec.describe 'Candidate tries to sign in without an account' do
include SignInHelper

before { FeatureFlag.deactivate :one_login_candidate_sign_in }

scenario 'Candidate signs in and receives an email inviting them to sign up' do
given_i_am_a_candidate_without_an_account

Expand Down

0 comments on commit 2b2dd3c

Please sign in to comment.