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>2022-07-22 18:10:04 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-07-22 18:10:04 +0300
commit632d0734750382e7c4e5f1b3c526a94acf6e7ce2 (patch)
tree7f212ce25ff1d0d4ea03f48ad6dedb09c9ad09eb /spec/lib/gitlab/ci/config/entry/rules/rule/changes_spec.rb
parent74b99c4264411703dedaf2d24cec2e6a5de6337d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/ci/config/entry/rules/rule/changes_spec.rb')
-rw-r--r--spec/lib/gitlab/ci/config/entry/rules/rule/changes_spec.rb27
1 files changed, 26 insertions, 1 deletions
diff --git a/spec/lib/gitlab/ci/config/entry/rules/rule/changes_spec.rb b/spec/lib/gitlab/ci/config/entry/rules/rule/changes_spec.rb
index 295561b3c4d..64f0a64074c 100644
--- a/spec/lib/gitlab/ci/config/entry/rules/rule/changes_spec.rb
+++ b/spec/lib/gitlab/ci/config/entry/rules/rule/changes_spec.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require 'fast_spec_helper'
+require 'spec_helper'
RSpec.describe Gitlab::Ci::Config::Entry::Rules::Rule::Changes do
let(:factory) do
@@ -119,6 +119,23 @@ RSpec.describe Gitlab::Ci::Config::Entry::Rules::Rule::Changes do
end
end
end
+
+ context 'with paths and compare_to' do
+ let(:config) { { paths: %w[app/ lib/], compare_to: 'branch1' } }
+
+ it { is_expected.to be_valid }
+
+ context 'when compare_to is not a string' do
+ let(:config) { { paths: %w[app/ lib/], compare_to: 1 } }
+
+ it { is_expected.not_to be_valid }
+
+ it 'returns information about errors' do
+ expect(entry.errors)
+ .to include(/should be a string/)
+ end
+ end
+ end
end
describe '#value' do
@@ -137,5 +154,13 @@ RSpec.describe Gitlab::Ci::Config::Entry::Rules::Rule::Changes do
it { is_expected.to eq(config) }
end
+
+ context 'with paths and compare_to' do
+ let(:config) do
+ { paths: ['app/', 'lib/'], compare_to: 'branch1' }
+ end
+
+ it { is_expected.to eq(config) }
+ end
end
end