Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
dex
Commits
7d4f41bf
Commit
7d4f41bf
authored
Oct 13, 2015
by
Bobby Rullo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
integration: check when there's no secret provided
parent
8360f18f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
admin_api_test.go
integration/admin_api_test.go
+12
-0
No files found.
integration/admin_api_test.go
View file @
7d4f41bf
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment