mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 14:11:10 +00:00
fix: makes the set language endpoint work without a return url
This commit is contained in:
1 parent
d10233f4e3
commit
c4135dbec9
3 files changed
+27
-29
No files matched your search
+15
@@ -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()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user