diff options
author | Matija Čupić <matteeyah@gmail.com> | 2019-09-12 13:11:21 +0300 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2019-09-12 13:11:21 +0300 |
commit | 54a3ec47e2ef169c998304a4a67d6bc6e66657fb (patch) | |
tree | 3a31ac5b9f2ac09aa3f90858b77c6055750283ae | |
parent | a9696122dbc2dc7cce12899b30b10de40cb9163d (diff) |
Add spec that checks unauthorized user behavior
-rw-r--r-- | spec/controllers/projects/artifacts_controller_spec.rb | 8 |
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 |