Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAlhayek committed May 22, 2024
1 parent aa62415 commit a0ea4fd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/OrchardCore.Modules/OrchardCore.Users/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ namespace OrchardCore.Users
public sealed class Startup : StartupBase
{
private static readonly string _accountControllerName = typeof(AccountController).ControllerName();
private static readonly string _emailConfirmationControllerName = typeof(EmailConfirmationController).ControllerName();


private readonly string _tenantName;
private UserOptions _userOptions;
Expand Down Expand Up @@ -105,6 +107,20 @@ public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilde
defaults: new { controller = _accountControllerName, action = nameof(AccountController.ExternalLogins) }
);

routes.MapAreaControllerRoute(
name: "ConfirmEmail",
areaName: UserConstants.Features.Users,
pattern: "ConfirmEmail",
defaults: new { controller = _emailConfirmationControllerName, action = nameof(EmailConfirmationController.ConfirmEmail) }
);

routes.MapAreaControllerRoute(
name: "ConfirmEmailSent",
areaName: UserConstants.Features.Users,
pattern: "ConfirmEmailSent",
defaults: new { controller = _emailConfirmationControllerName, action = nameof(EmailConfirmationController.ConfirmEmailSent) }
);

builder.UseAuthorization();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public async Task Register_WhenRequireEmailConfirmation_RedirectToConfirmEmailSe

// Assert
Assert.Equal(HttpStatusCode.Redirect, responseFromPost.StatusCode);
Assert.Equal($"/{context.TenantName}/{nameof(RegistrationController.ConfirmEmailSent)}", responseFromPost.Headers.Location.ToString());
Assert.Equal($"/{context.TenantName}/ConfirmEmailSent", responseFromPost.Headers.Location.ToString());

await context.UsingTenantScopeAsync(async scope =>
{
Expand Down

0 comments on commit a0ea4fd

Please sign in to comment.