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
Kazuhiko Shiozaki
gitlab-ce
Commits
bda0a755
Commit
bda0a755
authored
Oct 02, 2012
by
Valeriy Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#1585 Api for user creation: rspec
parent
705e9f40
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
spec/requests/api/users_spec.rb
spec/requests/api/users_spec.rb
+21
-0
No files found.
spec/requests/api/users_spec.rb
View file @
bda0a755
...
...
@@ -4,6 +4,7 @@ describe Gitlab::API do
include
ApiHelpers
let
(
:user
)
{
Factory
:user
}
let
(
:admin
)
{
Factory
:admin
}
let
(
:key
)
{
Factory
:key
,
user:
user
}
describe
"GET /users"
do
...
...
@@ -32,6 +33,26 @@ describe Gitlab::API do
end
end
describe
"POST /users"
do
before
{
admin
}
it
"should not create invalid user"
do
post
api
(
"/users"
,
admin
),
{
email:
"invalid email"
}
response
.
status
.
should
==
404
end
it
"should create user"
do
expect
{
post
api
(
"/users"
,
admin
),
Factory
.
attributes
(
:user
)
}.
to
change
{
User
.
count
}.
by
(
1
)
end
it
"shouldn't available for non admin users"
do
post
api
(
"/users"
,
user
),
Factory
.
attributes
(
:user
)
response
.
status
.
should
==
403
end
end
describe
"GET /user"
do
it
"should return current user"
do
get
api
(
"/user"
,
user
)
...
...
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