summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2019-01-16 20:51:41 +0100
committerMatija Čupić <matteeyah@gmail.com>2019-01-16 21:38:17 +0100
commit09d8c77ab2338593a303d73360dc9e5db706394b (patch)
treeabd28b5dfc33168c45703256fe7d19647d268e0e /spec
parentdedaec13a57abdbeaded37c1ae9526a4f3d82e8b (diff)
downloadgitlab-ce-09d8c77ab2338593a303d73360dc9e5db706394b.tar.gz
Prevent checking protected_ref? for ambiguous refs
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/ci/pipeline/chain/command_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/pipeline/chain/command_spec.rb b/spec/lib/gitlab/ci/pipeline/chain/command_spec.rb
index 6aa802ce6fd..a00d4339828 100644
--- a/spec/lib/gitlab/ci/pipeline/chain/command_spec.rb
+++ b/spec/lib/gitlab/ci/pipeline/chain/command_spec.rb
@@ -181,6 +181,17 @@ describe Gitlab::Ci::Pipeline::Chain::Command do
it { is_expected.to eq(false) }
end
+
+ context 'when ref is ambiguous' do
+ before do
+ project.repository.add_tag(project.creator, 'ref', 'master')
+ project.repository.add_branch(project.creator, 'ref', 'master')
+ end
+
+ it 'does not raise an error' do
+ expect { subject }.not_to raise_error
+ end
+ end
end
describe '#ambiguous_ref' do