summaryrefslogtreecommitdiff
path: root/spec/services/users
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-10 09:08:56 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-10 09:08:56 +0000
commitb4ded0ba7b4d2cdbed5b1f331cf2083a25ee4d7c (patch)
tree6694fa9d8f3e226597cc01dfb8e3e07b50ae85b6 /spec/services/users
parent2aaef94c80937d9d188f7b9cbbad2dcd1508c3c1 (diff)
downloadgitlab-ce-b4ded0ba7b4d2cdbed5b1f331cf2083a25ee4d7c.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/users')
-rw-r--r--spec/services/users/destroy_service_spec.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/services/users/destroy_service_spec.rb b/spec/services/users/destroy_service_spec.rb
index d9335cef5cc..f972fb4c5b9 100644
--- a/spec/services/users/destroy_service_spec.rb
+++ b/spec/services/users/destroy_service_spec.rb
@@ -121,10 +121,17 @@ describe Users::DestroyService do
before do
solo_owned.group_members = [member]
- service.execute(user)
+ end
+
+ it 'returns the user with attached errors' do
+ expect(service.execute(user)).to be(user)
+ expect(user.errors.full_messages).to eq([
+ 'You must transfer ownership or delete groups before you can remove user'
+ ])
end
it 'does not delete the user' do
+ service.execute(user)
expect(User.find(user.id)).to eq user
end
end