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
Tatuya Kamada
gitlab-ce
Commits
c3f2de68
Commit
c3f2de68
authored
Apr 22, 2015
by
Nihad Abbasov
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8831 from bladealslayer/fix/api-user-tests
Fix user API tests succeeding for the wrong reason
parents
8d9c7305
e5b32f3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
spec/requests/api/users_spec.rb
spec/requests/api/users_spec.rb
+9
-4
No files found.
spec/requests/api/users_spec.rb
View file @
c3f2de68
...
...
@@ -110,17 +110,22 @@ describe API::API, api: true do
end
it
'should return 400 error if name not given'
do
post
api
(
'/users'
,
admin
),
email:
'test@example.com'
,
password:
'pass1234'
post
api
(
'/users'
,
admin
),
attributes_for
(
:user
).
except
(
:name
)
expect
(
response
.
status
).
to
eq
(
400
)
end
it
'should return 400 error if password not given'
do
post
api
(
'/users'
,
admin
),
email:
'test@example.com'
,
name:
'test'
post
api
(
'/users'
,
admin
),
attributes_for
(
:user
).
except
(
:password
)
expect
(
response
.
status
).
to
eq
(
400
)
end
it
"should return 400 error if email not given"
do
post
api
(
'/users'
,
admin
),
password:
'pass1234'
,
name:
'test'
it
'should return 400 error if email not given'
do
post
api
(
'/users'
,
admin
),
attributes_for
(
:user
).
except
(
:email
)
expect
(
response
.
status
).
to
eq
(
400
)
end
it
'should return 400 error if username not given'
do
post
api
(
'/users'
,
admin
),
attributes_for
(
:user
).
except
(
:username
)
expect
(
response
.
status
).
to
eq
(
400
)
end
...
...
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