summaryrefslogtreecommitdiff
path: root/spec/services/users/block_service_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
commit48aff82709769b098321c738f3444b9bdaa694c6 (patch)
treee00c7c43e2d9b603a5a6af576b1685e400410dee /spec/services/users/block_service_spec.rb
parent879f5329ee916a948223f8f43d77fba4da6cd028 (diff)
downloadgitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'spec/services/users/block_service_spec.rb')
-rw-r--r--spec/services/users/block_service_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/services/users/block_service_spec.rb b/spec/services/users/block_service_spec.rb
index e170a5494aa..45a5b1e5100 100644
--- a/spec/services/users/block_service_spec.rb
+++ b/spec/services/users/block_service_spec.rb
@@ -34,5 +34,15 @@ RSpec.describe Users::BlockService do
expect { operation }.not_to change { user.state }
end
end
+
+ context 'when internal user' do
+ let(:user) { create(:user, :bot) }
+
+ it 'returns error result' do
+ expect(operation[:status]).to eq(:error)
+ expect(operation[:message]).to eq('An internal user cannot be blocked')
+ expect(operation[:http_status]).to eq(403)
+ end
+ end
end
end