Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
5b657a65
Commit
5b657a65
authored
Sep 29, 2013
by
Boyan Tabakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test cases to verify admin status of users created via API.
parent
479631aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
spec/requests/api/users_spec.rb
spec/requests/api/users_spec.rb
+19
-0
No files found.
spec/requests/api/users_spec.rb
View file @
5b657a65
...
@@ -62,6 +62,25 @@ describe API::API do
...
@@ -62,6 +62,25 @@ describe API::API do
new_user
.
can_create_group
.
should
==
true
new_user
.
can_create_group
.
should
==
true
end
end
it
"should create non-admin user"
do
post
api
(
'/users'
,
admin
),
attributes_for
(
:user
,
admin:
false
,
can_create_group:
false
)
response
.
status
.
should
==
201
user_id
=
json_response
[
'id'
]
new_user
=
User
.
find
(
user_id
)
new_user
.
should_not
==
nil
new_user
.
admin
.
should
==
false
new_user
.
can_create_group
.
should
==
false
end
it
"should create non-admin users by default"
do
post
api
(
'/users'
,
admin
),
attributes_for
(
:user
)
response
.
status
.
should
==
201
user_id
=
json_response
[
'id'
]
new_user
=
User
.
find
(
user_id
)
new_user
.
should_not
==
nil
new_user
.
admin
.
should
==
false
end
it
"should return 201 Created on success"
do
it
"should return 201 Created on success"
do
post
api
(
"/users"
,
admin
),
attributes_for
(
:user
,
projects_limit:
3
)
post
api
(
"/users"
,
admin
),
attributes_for
(
:user
,
projects_limit:
3
)
response
.
status
.
should
==
201
response
.
status
.
should
==
201
...
...
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