Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-11-13 19:27:00 +0300
committerMatija Čupić <matteeyah@gmail.com>2018-11-13 21:00:28 +0300
commitb7e5f73cd7dca105d2bd0dbab559439ee00aa91a (patch)
tree5e1d0908047bd483b55a455878d4817b5948a51d /spec/services/ci/destroy_pipeline_service_spec.rb
parent0bc14b452218277a55f71ab22bed724b696ecf28 (diff)
Raise exception when user is not authorized
Diffstat (limited to 'spec/services/ci/destroy_pipeline_service_spec.rb')
-rw-r--r--spec/services/ci/destroy_pipeline_service_spec.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/spec/services/ci/destroy_pipeline_service_spec.rb b/spec/services/ci/destroy_pipeline_service_spec.rb
index 9f449dd73e8..097daf67feb 100644
--- a/spec/services/ci/destroy_pipeline_service_spec.rb
+++ b/spec/services/ci/destroy_pipeline_service_spec.rb
@@ -53,14 +53,8 @@ describe ::Ci::DestroyPipelineService do
context 'user is not owner' do
let(:user) { create(:user) }
- it 'returns false' do
- is_expected.to eq(false)
- end
-
- it 'does not destroy the pipeline' do
- subject
-
- expect { pipeline.reload }.not_to raise_error
+ it 'raises an exception' do
+ expect { subject }.to raise_error(Gitlab::Access::AccessDeniedError)
end
end
end