Commit 7d4f41bf authored by Bobby Rullo's avatar Bobby Rullo

integration: check when there's no secret provided

parent 8360f18f
...@@ -147,6 +147,7 @@ func TestCreateAdmin(t *testing.T) { ...@@ -147,6 +147,7 @@ func TestCreateAdmin(t *testing.T) {
admn *adminschema.Admin admn *adminschema.Admin
errCode int errCode int
secret string secret string
noSecret bool
}{ }{
{ {
admn: &adminschema.Admin{ admn: &adminschema.Admin{
...@@ -163,6 +164,14 @@ func TestCreateAdmin(t *testing.T) { ...@@ -163,6 +164,14 @@ func TestCreateAdmin(t *testing.T) {
errCode: http.StatusUnauthorized, errCode: http.StatusUnauthorized,
secret: "bad_secret", secret: "bad_secret",
}, },
{
admn: &adminschema.Admin{
Email: "foo@example.com",
Password: "foopass",
},
errCode: http.StatusUnauthorized,
noSecret: true,
},
{ {
// duplicate Email // duplicate Email
admn: &adminschema.Admin{ admn: &adminschema.Admin{
...@@ -187,6 +196,9 @@ func TestCreateAdmin(t *testing.T) { ...@@ -187,6 +196,9 @@ func TestCreateAdmin(t *testing.T) {
secret: tt.secret, secret: tt.secret,
} }
} }
if tt.noSecret {
f.hc.Transport = http.DefaultTransport
}
defer f.close() defer f.close()
admn, err := f.adClient.Admin.Create(tt.admn).Do() admn, err := f.adClient.Admin.Create(tt.admn).Do()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment