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
b7559e32
Commit
b7559e32
authored
Sep 14, 2021
by
Serena Fang
Committed by
Matthias Käppler
Sep 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove repeat creation of deactivated user
parent
1ec37548
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
spec/requests/api/users_spec.rb
spec/requests/api/users_spec.rb
+4
-9
No files found.
spec/requests/api/users_spec.rb
View file @
b7559e32
...
...
@@ -2602,15 +2602,13 @@ RSpec.describe API::Users do
let
(
:api_user
)
{
admin
}
context
'for a deactivated user'
do
before
do
user
.
deactivate
end
let
(
:user_id
)
{
deactivated_user
.
id
}
it
'activates a deactivated user'
do
activate
expect
(
response
).
to
have_gitlab_http_status
(
:created
)
expect
(
user
.
reload
.
state
).
to
eq
(
'active'
)
expect
(
deactivated_
user
.
reload
.
state
).
to
eq
(
'active'
)
end
end
...
...
@@ -2714,15 +2712,13 @@ RSpec.describe API::Users do
end
context
'for a deactivated user'
do
before
do
user
.
deactivate
end
let
(
:user_id
)
{
deactivated_user
.
id
}
it
'returns 201'
do
deactivate
expect
(
response
).
to
have_gitlab_http_status
(
:created
)
expect
(
user
.
reload
.
state
).
to
eq
(
'deactivated'
)
expect
(
deactivated_
user
.
reload
.
state
).
to
eq
(
'deactivated'
)
end
end
...
...
@@ -2791,7 +2787,6 @@ RSpec.describe API::Users do
describe
'POST /users/:id/approve'
do
subject
(
:approve
)
{
post
api
(
"/users/
#{
user_id
}
/approve"
,
api_user
)
}
let_it_be
(
:deactivated_user
)
{
create
(
:user
,
:deactivated
)
}
let_it_be
(
:blocked_user
)
{
create
(
:user
,
:blocked
)
}
context
'performed by a non-admin user'
do
...
...
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