Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-09-06 09:09:17 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-09-06 09:09:17 +0300
commit578fc865330cb9ce65746ea5c03e993348e62c96 (patch)
tree3c8175f1d2192633a17a4a85b0824b07d055c990 /spec/models
parent23d951df2d16aea96dbd78fd8afe2e22a4794115 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/ci/pipeline_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb
index 597d532f8f1..b3d0b6af926 100644
--- a/spec/models/ci/pipeline_spec.rb
+++ b/spec/models/ci/pipeline_spec.rb
@@ -183,6 +183,28 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep do
end
end
+ describe '.where_not_sha' do
+ let_it_be(:pipeline) { create(:ci_pipeline, sha: 'abcx') }
+ let_it_be(:pipeline_2) { create(:ci_pipeline, sha: 'abc') }
+
+ let(:sha) { 'abc' }
+
+ subject { described_class.where_not_sha(sha) }
+
+ it 'returns the pipeline without the specified sha' do
+ is_expected.to contain_exactly(pipeline)
+ end
+
+ context 'when argument is array' do
+ let(:sha) { %w[abc abcx] }
+
+ it 'returns the pipelines without the specified shas' do
+ pipeline_3 = create(:ci_pipeline, sha: 'abcy')
+ is_expected.to contain_exactly(pipeline_3)
+ end
+ end
+ end
+
describe '.for_source_sha' do
subject { described_class.for_source_sha(source_sha) }