Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
systemes-dinformation
project-template
SDK-GO
Commits
b515b737
Commit
b515b737
authored
May 04, 2020
by
Alexis POYEN
Browse files
Fix : test
parent
ba832151
Pipeline
#5150
passed with stages
in 3 minutes and 25 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
internal/rootmux/admin_test.go
View file @
b515b737
...
...
@@ -64,14 +64,14 @@ func AdminTests(t *testing.T) {
xsrfHeader
:=
tester
.
Header
{
Key
:
"XSRF-TOKEN"
,
Value
:
token
.
XSRFToken
}
// Create a Client
do
(
"POST"
,
apiAdminUsers
,
xsrfHeader
,
`{"login":"UserTest","password": "password","role":"CLIENT"}`
,
200
,
`{"id":
7
,"idOAuth":"","login":"UserTest","role":"CLIENT"`
)
do
(
"POST"
,
apiAdminUsers
,
xsrfHeader
,
`{"login":"UserTest","password": "password","role":"CLIENT"}`
,
200
,
`{"id":
9
,"idOAuth":"","login":"UserTest","role":"CLIENT"`
)
// Create a Banker
do
(
"POST"
,
apiAdminUsers
,
xsrfHeader
,
`{"login":"BankerTest","password": "password","role":"BANKER"}`
,
200
,
`{"id":
8
,"idOAuth":"","login":"BankerTest","role":"BANKER"`
)
do
(
"POST"
,
apiAdminUsers
,
xsrfHeader
,
`{"login":"BankerTest","password": "password","role":"BANKER"}`
,
200
,
`{"id":
10
,"idOAuth":"","login":"BankerTest","role":"BANKER"`
)
// Get all users
do
(
"GET"
,
apiAdminUsers
,
xsrfHeader
,
``
,
200
,
`[{"id":1,"idOAuth":"","login":"Dupond"`
)
// Delete created users
do
(
"DELETE"
,
"/api/admin/users/
7
"
,
xsrfHeader
,
``
,
200
,
``
)
do
(
"DELETE"
,
"/api/admin/users/
8
"
,
xsrfHeader
,
``
,
200
,
``
)
do
(
"DELETE"
,
"/api/admin/users/
9
"
,
xsrfHeader
,
``
,
200
,
``
)
do
(
"DELETE"
,
"/api/admin/users/
10
"
,
xsrfHeader
,
``
,
200
,
``
)
}
// Do an OAuth2 login with an known admin
do
(
"GET"
,
"/OAuth2Login"
,
noH
,
""
,
200
,
"<!DOCTYPE html>"
)
...
...
Write
Preview
Supports
Markdown
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