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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
0820adcf
Commit
0820adcf
authored
Oct 01, 2020
by
sfang97
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DRY user 404 test
parent
a30a420e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
spec/requests/api/users_spec.rb
spec/requests/api/users_spec.rb
+6
-2
No files found.
spec/requests/api/users_spec.rb
View file @
0820adcf
...
@@ -2400,7 +2400,9 @@ RSpec.describe API::Users, :do_not_mock_admin_mode do
...
@@ -2400,7 +2400,9 @@ RSpec.describe API::Users, :do_not_mock_admin_mode do
end
end
describe
'POST /users/:id/deactivate'
do
describe
'POST /users/:id/deactivate'
do
subject
{
post
api
(
"/users/
#{
user
.
id
}
/deactivate"
,
api_user
)
}
subject
{
post
api
(
"/users/
#{
user_id
}
/deactivate"
,
api_user
)
}
let
(
:user_id
)
{
user
.
id
}
context
'performed by a non-admin user'
do
context
'performed by a non-admin user'
do
let
(
:api_user
)
{
user
}
let
(
:api_user
)
{
user
}
...
@@ -2496,8 +2498,10 @@ RSpec.describe API::Users, :do_not_mock_admin_mode do
...
@@ -2496,8 +2498,10 @@ RSpec.describe API::Users, :do_not_mock_admin_mode do
end
end
context
'for a user that does not exist'
do
context
'for a user that does not exist'
do
let
(
:user_id
)
{
0
}
before
do
before
do
post
api
(
"/users/0/deactivate"
,
admin
)
subject
end
end
it_behaves_like
'404'
it_behaves_like
'404'
...
...
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