summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorManoj MJ <mmj@gitlab.com>2019-06-19 07:08:56 +0000
committerJames Lopez <james@gitlab.com>2019-06-19 07:08:56 +0000
commit53b17f030161ba2afade8fe3d41b849a7fa41a89 (patch)
tree9f911580f4bc5d78cb66ffe7e16d1f77f7d23f64 /spec/lib
parent69e1bd389f3cb04d451900f981be646462ffd039 (diff)
downloadgitlab-ce-53b17f030161ba2afade8fe3d41b849a7fa41a89.tar.gz
Add documentation and tests
This commit adds - feature specs - to test the ability of a user with "developer" permission to delete tags in repositories. - documentation
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/checks/tag_check_spec.rb5
-rw-r--r--spec/lib/gitlab/git_access_spec.rb2
2 files changed, 3 insertions, 4 deletions
diff --git a/spec/lib/gitlab/checks/tag_check_spec.rb b/spec/lib/gitlab/checks/tag_check_spec.rb
index b1258270611..80e9eb504ad 100644
--- a/spec/lib/gitlab/checks/tag_check_spec.rb
+++ b/spec/lib/gitlab/checks/tag_check_spec.rb
@@ -8,9 +8,8 @@ describe Gitlab::Checks::TagCheck do
describe '#validate!' do
let(:ref) { 'refs/tags/v1.0.0' }
- it 'raises an error' do
- allow(user_access).to receive(:can_do_action?).with(:push_code).and_return(true)
- expect(user_access).to receive(:can_do_action?).with(:admin_project).and_return(false)
+ it 'raises an error when user does not have access' do
+ allow(user_access).to receive(:can_do_action?).with(:admin_tag).and_return(false)
expect { subject.validate! }.to raise_error(Gitlab::GitAccess::UnauthorizedError, 'You are not allowed to change existing tags on this project.')
end
diff --git a/spec/lib/gitlab/git_access_spec.rb b/spec/lib/gitlab/git_access_spec.rb
index 634c370d211..b9c21b3a7bd 100644
--- a/spec/lib/gitlab/git_access_spec.rb
+++ b/spec/lib/gitlab/git_access_spec.rb
@@ -831,7 +831,7 @@ describe Gitlab::GitAccess do
push_master: true,
push_protected_branch: false,
push_remove_protected_branch: false,
- push_tag: false,
+ push_tag: true,
push_new_tag: true,
push_all: false,
merge_into_protected_branch: false