1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2024-11-30 08:47:11 +02:00

Increased test coverage

This commit is contained in:
Florian Krauthan 2017-02-08 15:22:48 -08:00
parent 128b7b7bac
commit fd59d62772

View File

@ -109,6 +109,30 @@ func TestAuthenticationService_Authenticated(t *testing.T) {
}
}
func TestAuthenticationService_Authenticated_WithBasicAuth(t *testing.T) {
setup()
defer teardown()
testClient.Authentication.SetBasicAuth("test-user", "test-password")
// Test before we've attempted to authenticate
if testClient.Authentication.Authenticated() != true {
t.Error("Expected true, but result was false")
}
}
func TestAuthenticationService_Authenticated_WithBasicAuthButNoUsername(t *testing.T) {
setup()
defer teardown()
testClient.Authentication.SetBasicAuth("", "test-password")
// Test before we've attempted to authenticate
if testClient.Authentication.Authenticated() != false {
t.Error("Expected false, but result was true")
}
}
func TestAithenticationService_GetUserInfo_AccessForbidden_Fail(t *testing.T) {
setup()
defer teardown()