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>2019-09-12 13:11:21 +0300
committerMatija Čupić <matteeyah@gmail.com>2019-09-12 13:11:21 +0300
commit54a3ec47e2ef169c998304a4a67d6bc6e66657fb (patch)
tree3a31ac5b9f2ac09aa3f90858b77c6055750283ae
parenta9696122dbc2dc7cce12899b30b10de40cb9163d (diff)
Add spec that checks unauthorized user behavior
-rw-r--r--spec/controllers/projects/artifacts_controller_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/controllers/projects/artifacts_controller_spec.rb b/spec/controllers/projects/artifacts_controller_spec.rb
index f1886232380..e813ce3906c 100644
--- a/spec/controllers/projects/artifacts_controller_spec.rb
+++ b/spec/controllers/projects/artifacts_controller_spec.rb
@@ -81,6 +81,14 @@ describe Projects::ArtifactsController do
expect(flash[:notice]).to eq('Artifact could not be deleted.')
end
end
+
+ context 'when user is not authorized' do
+ let(:user) { create(:user) }
+
+ it 'does not delete the artifact' do
+ expect { subject }.not_to change { Ci::JobArtifact.count }
+ end
+ end
end
describe 'GET download' do