diff options
Diffstat (limited to 'spec/lib/gitlab/ci/config/entry/include/rules_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/config/entry/include/rules_spec.rb | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/spec/lib/gitlab/ci/config/entry/include/rules_spec.rb b/spec/lib/gitlab/ci/config/entry/include/rules_spec.rb index 05db81abfc1..503020e2202 100644 --- a/spec/lib/gitlab/ci/config/entry/include/rules_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/include/rules_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'spec_helper' # Change this to fast spec helper when FF `ci_refactor_external_rules` is removed +require 'fast_spec_helper' require_dependency 'active_model' RSpec.describe Gitlab::Ci::Config::Entry::Include::Rules, feature_category: :pipeline_composition do @@ -50,7 +50,7 @@ RSpec.describe Gitlab::Ci::Config::Entry::Include::Rules, feature_category: :pip entry.compose! end - it_behaves_like 'an invalid config', /contains unknown keys: changes/ + it_behaves_like 'a valid config' end end @@ -80,7 +80,8 @@ RSpec.describe Gitlab::Ci::Config::Entry::Include::Rules, feature_category: :pip let(:config) do [ { if: '$THIS == "that"' }, - { if: '$SKIP', when: 'never' } + { if: '$SKIP', when: 'never' }, + { changes: ['Dockerfile'] } ] end @@ -96,7 +97,8 @@ RSpec.describe Gitlab::Ci::Config::Entry::Include::Rules, feature_category: :pip is_expected.to eq( [ { if: '$THIS == "that"' }, - { if: '$SKIP', when: 'never' } + { if: '$SKIP', when: 'never' }, + { changes: { paths: ['Dockerfile'] } } ] ) end @@ -115,30 +117,5 @@ RSpec.describe Gitlab::Ci::Config::Entry::Include::Rules, feature_category: :pip end end end - - context 'when FF `ci_refactor_external_rules` is disabled' do - before do - stub_feature_flags(ci_refactor_external_rules: false) - end - - context 'with an "if"' do - let(:config) do - [{ if: '$THIS == "that"' }] - end - - it { is_expected.to eq(config) } - end - - context 'with a list of two rules' do - let(:config) do - [ - { if: '$THIS == "that"' }, - { if: '$SKIP' } - ] - end - - it { is_expected.to eq(config) } - end - end end end |