mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
Added user logout method and unit tests to cover it
This commit is contained in:
parent
55560611e8
commit
759540c837
4 changed files with 51 additions and 6 deletions
|
@ -330,5 +330,29 @@ namespace PlexRequests.UI.Tests
|
|||
PlexMock.Verify(x => x.SignIn(It.IsAny<string>(), It.IsAny<string>()), Times.Never);
|
||||
PlexMock.Verify(x => x.GetUsers(It.IsAny<string>()), Times.Never);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Logout()
|
||||
{
|
||||
var bootstrapper = new ConfigurableBootstrapper(with =>
|
||||
{
|
||||
with.Module<UserLoginModule>();
|
||||
with.Dependency(AuthMock.Object);
|
||||
with.Dependency(PlexMock.Object);
|
||||
with.RootPathProvider<TestRootPathProvider>();
|
||||
});
|
||||
|
||||
bootstrapper.WithSession(new Dictionary<string, object> { {SessionKeys.UsernameKey, "abc"} });
|
||||
|
||||
var browser = new Browser(bootstrapper);
|
||||
var result = browser.Get("/userlogin/logout", with =>
|
||||
{
|
||||
with.HttpRequest();
|
||||
with.Header("Accept", "application/json");
|
||||
});
|
||||
|
||||
Assert.That(HttpStatusCode.SeeOther, Is.EqualTo(result.StatusCode));
|
||||
Assert.That(result.Context.Request.Session[SessionKeys.UsernameKey], Is.Null);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue