fix: makes the set language endpoint work without a return url

This commit is contained in:
BinaryAlley committed 2026-08-17 11:52:33 -07:00
1 parent d10233f4e3
commit c4135dbec9
3 files changed
+27 -29

No files matched your search

@@ -45,6 +45,21 @@ public class SetLanguageEndpointTests : IClassFixture<LuminaWebFactory>
Assert.Contains("de-DE", response.Headers.GetValues("Set-Cookie").First());
}
[Fact]
public async Task SetLanguage_WhenCalledByAuthenticatedUserWithoutReturnUrl_ShouldRedirectToHomePageWithNewCulture()
{
// Arrange
AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory);
// Act
HttpResponseMessage response = await webClient.Client.GetAsync("/en-us/tools/language/set-language?newCulture=de-DE");
// Assert
Assert.Equal(HttpStatusCode.Redirect, response.StatusCode);
Assert.Equal("/de-de", response.Headers.Location!.ToString());
Assert.Contains("de-DE", response.Headers.GetValues("Set-Cookie").First());
}
[Fact]
public async Task SetLanguage_WhenCalledWithoutAuthentication_ShouldRedirectToLogin()
{