diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/lib/gitlab/ci/config/entry/product/variables_spec.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/lib/gitlab/ci/config/entry/product/variables_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/config/entry/product/variables_spec.rb | 71 |
1 files changed, 9 insertions, 62 deletions
diff --git a/spec/lib/gitlab/ci/config/entry/product/variables_spec.rb b/spec/lib/gitlab/ci/config/entry/product/variables_spec.rb index 407efb438b5..5e920ce34e0 100644 --- a/spec/lib/gitlab/ci/config/entry/product/variables_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/product/variables_spec.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true -# After Feature one_dimensional_matrix is removed, this can be changed back to fast_spec_helper -require 'spec_helper' +require 'fast_spec_helper' require_dependency 'active_model' RSpec.describe Gitlab::Ci::Config::Entry::Product::Variables do @@ -46,70 +45,18 @@ RSpec.describe Gitlab::Ci::Config::Entry::Product::Variables do end end - context 'with one_dimensional_matrix feature flag enabled' do - context 'with only one variable' do - before do - stub_feature_flags(one_dimensional_matrix: true) - end - let(:config) { { VAR: 'test' } } - - describe '#valid?' do - it 'is valid' do - expect(entry).to be_valid - end - end + context 'with only one variable' do + let(:config) { { VAR: 'test' } } - describe '#errors' do - it 'does not append errors' do - expect(entry.errors).to be_empty - end + describe '#valid?' do + it 'is valid' do + expect(entry).to be_valid end end - end - - context 'with one_dimensional_matrix feature flag disabled' do - context 'when entry value is not correct' do - before do - stub_feature_flags(one_dimensional_matrix: false) - end - shared_examples 'invalid variables' do |message| - describe '#errors' do - it 'saves errors' do - expect(entry.errors).to include(message) - end - end - - describe '#valid?' do - it 'is not valid' do - expect(entry).not_to be_valid - end - end - end - - context 'with array' do - let(:config) { [:VAR, 'test'] } - it_behaves_like 'invalid variables', /should be a hash of key value pairs/ - end - - context 'with empty array' do - let(:config) { { VAR: 'test', VAR2: [] } } - - it_behaves_like 'invalid variables', /should be a hash of key value pairs/ - end - - context 'with nested array' do - let(:config) { { VAR: 'test', VAR2: [1, [2]] } } - - it_behaves_like 'invalid variables', /should be a hash of key value pairs/ - end - - context 'with one_dimensional_matrix feature flag disabled' do - context 'with only one variable' do - let(:config) { { VAR: 'test' } } - - it_behaves_like 'invalid variables', /variables config requires at least 2 items/ - end + describe '#errors' do + it 'does not append errors' do + expect(entry.errors).to be_empty end end end |