diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/CheckAnswers.cshtml b/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/CheckAnswers.cshtml index 3847308b3..0f8b81045 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/CheckAnswers.cshtml +++ b/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/CheckAnswers.cshtml @@ -5,7 +5,7 @@ } @section BeforeContent { - + }
@@ -13,9 +13,24 @@

@ViewBag.Title

-

Your GOV.UK One Login could not be connected to your teaching record.

+

GOV.UK One Login

-

Check your answers and try again.

+ + + Email + @Model.Email + + + Name + @Model.Name + + + Date of birth + @Model.DateOfBirth.ToString("d MMMM yyyy") + + + +

Additional details

@@ -42,7 +57,7 @@ - Continue + Submit support request
diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/CheckAnswers.cshtml.cs b/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/CheckAnswers.cshtml.cs index d48275245..bdf6189ff 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/CheckAnswers.cshtml.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/CheckAnswers.cshtml.cs @@ -1,3 +1,4 @@ +using System.Security.Claims; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.RazorPages; @@ -10,6 +11,12 @@ public class CheckAnswersModel(SignInJourneyHelper helper) : PageModel { public JourneyInstance? JourneyInstance { get; set; } + public string? Email { get; set; } + + public string? Name { get; set; } + + public DateOnly DateOfBirth { get; set; } + public string? NationalInsuranceNumber => JourneyInstance!.State.NationalInsuranceNumber; public string? Trn => JourneyInstance!.State.Trn; @@ -18,7 +25,7 @@ public void OnGet() { } - public IActionResult OnPost() => Redirect(helper.LinkGenerator.NotFound(JourneyInstance!.InstanceId)); + public IActionResult OnPost() => throw new NotImplementedException(); public override void OnPageHandlerExecuting(PageHandlerExecutingContext context) { @@ -44,5 +51,12 @@ public override void OnPageHandlerExecuting(PageHandlerExecutingContext context) // Not answered the TRN question context.Result = Redirect(helper.LinkGenerator.Trn(JourneyInstance.InstanceId)); } + + if (context.Result is null) + { + Email = state.OneLoginAuthenticationTicket!.Principal.FindFirstValue("email")!; + Name = string.Join(" ", state.VerifiedNames!.First()); + DateOfBirth = state.VerifiedDatesOfBirth!.First(); + } } } diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/Connect.cshtml b/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/Connect.cshtml index 53d47d548..cff94ab56 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/Connect.cshtml +++ b/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/Connect.cshtml @@ -1,31 +1,29 @@ @page "/connect" @model TeachingRecordSystem.AuthorizeAccess.Pages.ConnectModel @{ - ViewBag.Title = "Connect your GOV.UK One Login to your teaching record"; + ViewBag.Title = "Find your teaching record"; } -
-
-
-
-

@ViewBag.Title

+ +
+

@ViewBag.Title

-
-

- You’ve verified your identity for your GOV.UK One Login. -

+
+
+

+ You’ve signed in to GOV.UK One Login and verified your identity. +

-

- You now need to connect it to your teaching record. You’ll be asked for your: -

    -
  • National Insurance number
  • -
  • teacher reference number
  • -
-

+

+ We’ll ask for your National Insurance number or teacher reference number (TRN) so we can find your teaching record. +

- Connect to your teaching record -
- +

+ You won’t need to do this again. +

+ + Find your teaching record +
-
+ diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/Found.cshtml b/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/Found.cshtml index daa370c4b..a9082c745 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/Found.cshtml +++ b/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/Found.cshtml @@ -1,24 +1,20 @@ @page "/found" @model TeachingRecordSystem.AuthorizeAccess.Pages.FoundModel @{ - ViewBag.Title = "We’ve found your teaching record"; + ViewBag.Title = "Your GOV.UK One Login is connected to your teaching record"; } -
-
-
- - - Your GOV.UK One Login is connected to your teaching record - - -

- You won’t need to do this again. -

+ + + + @ViewBag.Title + + +

+ You won’t need to do this again. +

- Access your teaching record -
-
- -
-
+ Access your teaching record + + + diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/NationalInsuranceNumber.cshtml b/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/NationalInsuranceNumber.cshtml index 4994927ed..e790ae17c 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/NationalInsuranceNumber.cshtml +++ b/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/NationalInsuranceNumber.cshtml @@ -11,9 +11,11 @@
+

@ViewBag.Title

+ - + Yes diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/NationalInsuranceNumber.cshtml.cs b/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/NationalInsuranceNumber.cshtml.cs index fc7a76ebd..cdaca94ad 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/NationalInsuranceNumber.cshtml.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/NationalInsuranceNumber.cshtml.cs @@ -15,7 +15,7 @@ public class NationalInsuranceNumberModel(SignInJourneyHelper helper) : PageMode public bool? FromCheckAnswers { get; set; } [BindProperty] - [Display(Name = "Do you have a National Insurance number?", Description = "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’.")] + [Display(Name = "Do you have a National Insurance number?")] [Required(ErrorMessage = "Select yes if you have a National Insurance number")] public bool? HaveNationalInsuranceNumber { get; set; } diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/NotFound.cshtml b/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/NotFound.cshtml index 1bfa5de6f..85dbd5bdf 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/NotFound.cshtml +++ b/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/NotFound.cshtml @@ -5,25 +5,31 @@ } @section BeforeContent { - + } -
-
-
-

Your GOV.UK One Login could not be connected to your teaching record

+ +
+

@ViewBag.Title

-
-

- You need to get support to access your teaching qualifications. +

+
+

+ We’ve been unable to match your answers to a teaching record.

-

- Your details will be sent to the Teaching Regulation Agency support team. +

Get support

+ +

+ Check your answers. If they’re correct, you can get support with accessing your teaching qualifications. +

+ +

+ We’ll check your details and contact you if we need any more information.

- Get support + Check your answers
-
+ diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/NotFound.cshtml.cs b/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/NotFound.cshtml.cs index afdc32314..612922949 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/NotFound.cshtml.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/NotFound.cshtml.cs @@ -1,3 +1,4 @@ +using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.RazorPages; using TeachingRecordSystem.FormFlow; @@ -13,6 +14,8 @@ public void OnGet() { } + public IActionResult OnPost() => Redirect(helper.LinkGenerator.CheckAnswers(JourneyInstance!.InstanceId)); + public override void OnPageHandlerExecuting(PageHandlerExecutingContext context) { var state = JourneyInstance!.State; diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/Trn.cshtml b/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/Trn.cshtml index 39d005672..f4f22a68b 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/Trn.cshtml +++ b/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/Trn.cshtml @@ -1,7 +1,7 @@ @page "/trn" @model TeachingRecordSystem.AuthorizeAccess.Pages.TrnModel @{ - ViewBag.Title = "What is your teacher reference number (TRN)?"; + ViewBag.Title = "Teacher reference number (TRN)"; } @section BeforeContent { @@ -11,9 +11,33 @@
+

@ViewBag.Title

+ + + About teacher reference numbers + +

+ You’ll have a TRN if you: +

    +
  • hold qualified teacher status (QTS) in England or Wales
  • +
  • hold early years teacher status (EYTS) in England
  • +
  • already hold a national professional qualification (NPQ)
  • +
  • are working towards QTS or a EYTS
  • +
+

+

+ Learn about TRNs including how to request one, or + find a lost TRN. +

+

+ You may not have one yet in you work in early years, further education or qualified as a teacher outside of England. +

+
+
+ - + Yes @@ -24,26 +48,6 @@ - - About TRNs - -

You’ll have a TRN if you:

-
    -
  • hold qualified teacher status (QTS) in England or Wales
  • -
  • hold early years teacher status (EYTS) in England
  • -
  • already hold a national professional qualification (NPQ)
  • -
  • are working towards QTS or a EYTS
  • -
-

- Learn about TRNs including how to request one, or find a lost TRN. -

-

- You may not have one yet if you work in early years, further education or qualified as a teacher outside of - England. -

-
-
- Continue
diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/Trn.cshtml.cs b/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/Trn.cshtml.cs index bbd420fb4..3d2c32121 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/Trn.cshtml.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/Pages/Trn.cshtml.cs @@ -15,14 +15,14 @@ public class TrnModel(SignInJourneyHelper helper) : PageModel public bool? FromCheckAnswers { get; set; } [BindProperty] - [Display(Name = "Do you have a teacher reference number (TRN)?")] - [Required(ErrorMessage = "Select yes if you have a TRN")] + [Display(Name = "Do you have a teacher reference number?")] + [Required(ErrorMessage = "Select yes if you have a teacher reference number")] public bool? HaveTrn { get; set; } [BindProperty] - [Display(Name = "TRN")] - [Required(ErrorMessage = "Enter your TRN")] - [RegularExpression(@"\A\D*(\d{1}\D*){7}\D*\Z", ErrorMessage = "Your TRN should contain 7 digits")] + [Display(Name = "Teacher reference number")] + [Required(ErrorMessage = "Enter your teacher reference number")] + [RegularExpression(@"\A\D*(\d{1}\D*){7}\D*\Z", ErrorMessage = "Your teacher reference number should contain 7 digits")] public string? Trn { get; set; } public void OnGet() @@ -46,7 +46,7 @@ public async Task OnPost() await JourneyInstance!.UpdateStateAsync(state => state.SetTrn(HaveTrn!.Value, Trn)); return await helper.TryMatchToTeachingRecord(JourneyInstance!) ? Redirect(helper.LinkGenerator.Found(JourneyInstance.InstanceId)) : - Redirect(helper.LinkGenerator.CheckAnswers(JourneyInstance.InstanceId)); + Redirect(helper.LinkGenerator.NotFound(JourneyInstance.InstanceId)); } public override void OnPageHandlerExecuting(PageHandlerExecutingContext context) diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/wwwroot/Styles/site.scss b/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/wwwroot/Styles/site.scss index 3a5e87c8a..3e7e2a1cd 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/wwwroot/Styles/site.scss +++ b/TeachingRecordSystem/src/TeachingRecordSystem.AuthorizeAccess/wwwroot/Styles/site.scss @@ -20,3 +20,7 @@ background-color: govuk-colour("light-grey"); } } + +.trs-two-thirds { + width: 66.6666666667%; +} diff --git a/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccess.EndToEndTests/SignInTests.cs b/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccess.EndToEndTests/SignInTests.cs index 3885a1649..2826f20e2 100644 --- a/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccess.EndToEndTests/SignInTests.cs +++ b/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccess.EndToEndTests/SignInTests.cs @@ -33,7 +33,7 @@ public async Task SignIn_UnknownVerifiedUser_MatchesWithNino() await page.GoToTestStartPage(); await page.WaitForUrlPathAsync("/connect"); - await page.ClickButton("Connect to your teaching record"); + await page.ClickButton("Find your teaching record"); await page.WaitForUrlPathAsync("/national-insurance-number"); await page.CheckAsync("text=Yes"); @@ -62,7 +62,7 @@ public async Task SignIn_UnknownVerifiedUserWithUnmatchedNino_MatchesWithTrn() await page.GoToTestStartPage(); await page.WaitForUrlPathAsync("/connect"); - await page.ClickButton("Connect to your teaching record"); + await page.ClickButton("Find your teaching record"); await page.WaitForUrlPathAsync("/national-insurance-number"); await page.CheckAsync("text=Yes"); @@ -71,7 +71,7 @@ public async Task SignIn_UnknownVerifiedUserWithUnmatchedNino_MatchesWithTrn() await page.WaitForUrlPathAsync("/trn"); await page.CheckAsync("text=Yes"); - await page.FillAsync("label:text-is('TRN')", person.Trn!); + await page.FillAsync("label:text-is('Teacher reference number')", person.Trn!); await page.ClickButton("Continue"); await page.WaitForUrlPathAsync("/found"); @@ -96,7 +96,7 @@ public async Task SignIn_UnknownVerifiedUserWithoutNino_MatchesWithTrn() await page.GoToTestStartPage(); await page.WaitForUrlPathAsync("/connect"); - await page.ClickButton("Connect to your teaching record"); + await page.ClickButton("Find your teaching record"); await page.WaitForUrlPathAsync("/national-insurance-number"); await page.CheckAsync("text=No"); @@ -104,7 +104,7 @@ public async Task SignIn_UnknownVerifiedUserWithoutNino_MatchesWithTrn() await page.WaitForUrlPathAsync("/trn"); await page.CheckAsync("text=Yes"); - await page.FillAsync("label:text-is('TRN')", person.Trn!); + await page.FillAsync("label:text-is('Teacher reference number')", person.Trn!); await page.ClickButton("Continue"); await page.WaitForUrlPathAsync("/found"); @@ -129,7 +129,7 @@ public async Task SignIn_UnknownVerifiedUser_DoesNotMatchWithNinoOrTrn() await page.GoToTestStartPage(); await page.WaitForUrlPathAsync("/connect"); - await page.ClickButton("Connect to your teaching record"); + await page.ClickButton("Find your teaching record"); await page.WaitForUrlPathAsync("/national-insurance-number"); await page.CheckAsync("text=Yes"); @@ -138,13 +138,13 @@ public async Task SignIn_UnknownVerifiedUser_DoesNotMatchWithNinoOrTrn() await page.WaitForUrlPathAsync("/trn"); await page.CheckAsync("text=Yes"); - await page.FillAsync("label:text-is('TRN')", await TestData.GenerateTrn()); - await page.ClickButton("Continue"); - - await page.WaitForUrlPathAsync("/check-answers"); + await page.FillAsync("label:text-is('Teacher reference number')", await TestData.GenerateTrn()); await page.ClickButton("Continue"); await page.WaitForUrlPathAsync("/not-found"); + await page.ClickButton("Check your answers"); + + await page.WaitForUrlPathAsync("/check-answers"); } [Fact] @@ -163,20 +163,20 @@ public async Task SignIn_UnknownVerifiedUserWithNeitherNinoNorTrn_DoesNotMatch() await page.GoToTestStartPage(); await page.WaitForUrlPathAsync("/connect"); - await page.ClickButton("Connect to your teaching record"); + await page.ClickButton("Find your teaching record"); await page.WaitForUrlPathAsync("/national-insurance-number"); await page.CheckAsync("text=No"); await page.ClickButton("Continue"); await page.WaitForUrlPathAsync("/trn"); - await page.CheckAsync("text=No"); - await page.ClickButton("Continue"); - - await page.WaitForUrlPathAsync("/check-answers"); + await page.CheckAsync("label:text-is('No')"); await page.ClickButton("Continue"); await page.WaitForUrlPathAsync("/not-found"); + await page.ClickButton("Check your answers"); + + await page.WaitForUrlPathAsync("/check-answers"); } [Fact] diff --git a/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccess.Tests/PageTests/CheckAnswersTests.cs b/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccess.Tests/PageTests/CheckAnswersTests.cs index 9b5eaacf9..d36f2696d 100644 --- a/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccess.Tests/PageTests/CheckAnswersTests.cs +++ b/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccess.Tests/PageTests/CheckAnswersTests.cs @@ -249,35 +249,4 @@ public async Task Post_AlreadyAuthenticated_RedirectsToStateRedirectUri() Assert.Equal(StatusCodes.Status302Found, (int)response.StatusCode); Assert.Equal($"{state.RedirectUri}?{journeyInstance.GetUniqueIdQueryParameter()}", response.Headers.Location?.OriginalString); } - - [Fact] - public async Task Post_ValidRequest_RedirectsToNotFoundPage() - { - // Arrange - var state = CreateNewState(); - var journeyInstance = await CreateJourneyInstance(state); - - var oneLoginUser = await TestData.CreateOneLoginUser(verified: true); - - var ticket = CreateOneLoginAuthenticationTicket(vtr: SignInJourneyHelper.AuthenticationOnlyVtr, oneLoginUser); - await GetSignInJourneyHelper().OnSignedInWithOneLogin(journeyInstance, ticket); - - var nationalInsuranceNumber = TestData.GenerateNationalInsuranceNumber(); - var trn = await TestData.GenerateTrn(); - - await journeyInstance.UpdateStateAsync(state => - { - state.SetNationalInsuranceNumber(true, nationalInsuranceNumber); - state.SetTrn(true, trn); - }); - - var request = new HttpRequestMessage(HttpMethod.Post, $"/check-answers?{journeyInstance.GetUniqueIdQueryParameter()}"); - - // Act - var response = await HttpClient.SendAsync(request); - - // Assert - Assert.Equal(StatusCodes.Status302Found, (int)response.StatusCode); - Assert.Equal($"/not-found?{journeyInstance.GetUniqueIdQueryParameter()}", response.Headers.Location?.OriginalString); - } } diff --git a/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccess.Tests/PageTests/NotFoundTests.cs b/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccess.Tests/PageTests/NotFoundTests.cs index 98d5c8de0..8631e1d78 100644 --- a/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccess.Tests/PageTests/NotFoundTests.cs +++ b/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccess.Tests/PageTests/NotFoundTests.cs @@ -139,4 +139,32 @@ await journeyInstance.UpdateStateAsync(async state => // Assert var doc = await AssertEx.HtmlResponse(response); } + + [Fact] + public async Task Post_ValidRequest_RedirectsToCheckAnswersPage() + { + // Arrange + var state = CreateNewState(); + var journeyInstance = await CreateJourneyInstance(state); + + var oneLoginUser = await TestData.CreateOneLoginUser(verified: true); + + var ticket = CreateOneLoginAuthenticationTicket(vtr: SignInJourneyHelper.AuthenticationOnlyVtr, oneLoginUser); + await GetSignInJourneyHelper().OnSignedInWithOneLogin(journeyInstance, ticket); + + await journeyInstance.UpdateStateAsync(async state => + { + state.SetNationalInsuranceNumber(true, TestData.GenerateNationalInsuranceNumber()); + state.SetTrn(true, await TestData.GenerateTrn()); + }); + + var request = new HttpRequestMessage(HttpMethod.Post, $"/not-found?{journeyInstance.GetUniqueIdQueryParameter()}"); + + // Act + var response = await HttpClient.SendAsync(request); + + // Assert + Assert.Equal(StatusCodes.Status302Found, (int)response.StatusCode); + Assert.Equal($"/check-answers?{journeyInstance.GetUniqueIdQueryParameter()}", response.Headers.Location?.OriginalString); + } } diff --git a/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccess.Tests/PageTests/TrnTests.cs b/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccess.Tests/PageTests/TrnTests.cs index 3ca7b7c40..463d87ad5 100644 --- a/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccess.Tests/PageTests/TrnTests.cs +++ b/TeachingRecordSystem/tests/TeachingRecordSystem.AuthorizeAccess.Tests/PageTests/TrnTests.cs @@ -267,7 +267,7 @@ public async Task Post_HaveTrnNotAnswered_RendersError() var response = await HttpClient.SendAsync(request); // Assert - await AssertEx.HtmlResponseHasError(response, "HaveTrn", "Select yes if you have a TRN"); + await AssertEx.HtmlResponseHasError(response, "HaveTrn", "Select yes if you have a teacher reference number"); } [Fact] @@ -299,7 +299,7 @@ public async Task Post_EmptyTrn_RendersError() var response = await HttpClient.SendAsync(request); // Assert - await AssertEx.HtmlResponseHasError(response, "Trn", "Enter your TRN"); + await AssertEx.HtmlResponseHasError(response, "Trn", "Enter your teacher reference number"); } [Fact] @@ -331,11 +331,11 @@ public async Task Post_InvalidTrn_RendersError() var response = await HttpClient.SendAsync(request); // Assert - await AssertEx.HtmlResponseHasError(response, "Trn", "Your TRN should contain 7 digits"); + await AssertEx.HtmlResponseHasError(response, "Trn", "Your teacher reference number should contain 7 digits"); } [Fact] - public async Task Post_NoTrnSpecified_UpdatesStateAndRedirectsToCheckAnswersPage() + public async Task Post_NoTrnSpecified_UpdatesStateAndRedirectsToNotFoundPage() { // Arrange var state = CreateNewState(); @@ -363,7 +363,7 @@ public async Task Post_NoTrnSpecified_UpdatesStateAndRedirectsToCheckAnswersPage // Assert Assert.Equal(StatusCodes.Status302Found, (int)response.StatusCode); - Assert.Equal($"/check-answers?{journeyInstance.GetUniqueIdQueryParameter()}", response.Headers.Location?.OriginalString); + Assert.Equal($"/not-found?{journeyInstance.GetUniqueIdQueryParameter()}", response.Headers.Location?.OriginalString); journeyInstance = await ReloadJourneyInstance(journeyInstance); state = journeyInstance.State; @@ -373,7 +373,7 @@ public async Task Post_NoTrnSpecified_UpdatesStateAndRedirectsToCheckAnswersPage } [Fact] - public async Task Post_ValidTrnButLookupFailed_UpdatesStateAndRedirectsToCheckAnswersPage() + public async Task Post_ValidTrnButLookupFailed_UpdatesStateAndRedirectsToNotFoundPage() { // Arrange var state = CreateNewState(); @@ -402,7 +402,7 @@ public async Task Post_ValidTrnButLookupFailed_UpdatesStateAndRedirectsToCheckAn // Assert Assert.Equal(StatusCodes.Status302Found, (int)response.StatusCode); - Assert.Equal($"/check-answers?{journeyInstance.GetUniqueIdQueryParameter()}", response.Headers.Location?.OriginalString); + Assert.Equal($"/not-found?{journeyInstance.GetUniqueIdQueryParameter()}", response.Headers.Location?.OriginalString); journeyInstance = await ReloadJourneyInstance(journeyInstance); state = journeyInstance.State;