diff options
author | Kamil TrzciĆski <kamil@gitlab.com> | 2018-01-26 17:05:04 +0000 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2018-02-09 12:16:29 -0600 |
commit | 02f93da8600a77e1502e89c3a65513a806c0d847 (patch) | |
tree | b89592dbcde57b79b15f592cdcc04d5c57057620 /spec/models/ci | |
parent | 68e31c098ec3984c42b921c07fec8593116e77ce (diff) | |
download | gitlab-ce-02f93da8600a77e1502e89c3a65513a806c0d847.tar.gz |
Merge branch 'mc/bug/38984-wildcard-protected-tags' into 'security-10-4'
Fix using wildcards in protected tags to expose protected variables
Diffstat (limited to 'spec/models/ci')
-rw-r--r-- | spec/models/ci/build_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 9e159c3f1fe..78fcbf6d47e 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -1590,7 +1590,7 @@ describe Ci::Build do context 'when the branch is protected' do before do - create(:protected_branch, project: build.project, name: build.ref) + allow(build.project).to receive(:protected_for?).with(build.ref).and_return(true) end it { is_expected.to include(protected_variable) } @@ -1598,7 +1598,7 @@ describe Ci::Build do context 'when the tag is protected' do before do - create(:protected_tag, project: build.project, name: build.ref) + allow(build.project).to receive(:protected_for?).with(build.ref).and_return(true) end it { is_expected.to include(protected_variable) } @@ -1635,7 +1635,7 @@ describe Ci::Build do context 'when the branch is protected' do before do - create(:protected_branch, project: build.project, name: build.ref) + allow(build.project).to receive(:protected_for?).with(build.ref).and_return(true) end it { is_expected.to include(protected_variable) } @@ -1643,7 +1643,7 @@ describe Ci::Build do context 'when the tag is protected' do before do - create(:protected_tag, project: build.project, name: build.ref) + allow(build.project).to receive(:protected_for?).with(build.ref).and_return(true) end it { is_expected.to include(protected_variable) } |