diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-08-28 21:40:52 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-09-03 23:49:10 +0900 |
commit | 3875983205fd3cdbdc93f18b118deaf098d75af1 (patch) | |
tree | 72d9f2e1099555d0766919df79d46fcbf1275148 /spec/lib/gitlab | |
parent | 4b0e31ba64118011ffc29c31bc771fa2568cd270 (diff) | |
download | gitlab-ce-3875983205fd3cdbdc93f18b118deaf098d75af1.tar.gz |
Impprove spec by godfat suggestions
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r-- | spec/lib/gitlab/ci/stage/seed_spec.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/lib/gitlab/ci/stage/seed_spec.rb b/spec/lib/gitlab/ci/stage/seed_spec.rb index 1e9cbbdfb77..515e06e38e5 100644 --- a/spec/lib/gitlab/ci/stage/seed_spec.rb +++ b/spec/lib/gitlab/ci/stage/seed_spec.rb @@ -26,7 +26,16 @@ describe Gitlab::Ci::Stage::Seed do expect(subject.builds).to all(include(project: pipeline.project)) expect(subject.builds) .to all(include(trigger_request: pipeline.trigger_requests.first)) - expect(subject.builds).to all(include(protected: true)) + end + + context 'when a ref is protected' do + before do + allow_any_instance_of(Project).to receive(:protected_for?).and_return(true) + end + + it 'returns unprotected builds' do + expect(subject.builds).to all(include(protected: true)) + end end context 'when a ref is unprotected' do |