summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r--spec/lib/gitlab/ci/stage/seed_spec.rb11
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