diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /spec/lib/gitlab/ci/variables/collection/sorted_spec.rb | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'spec/lib/gitlab/ci/variables/collection/sorted_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/variables/collection/sorted_spec.rb | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/spec/lib/gitlab/ci/variables/collection/sorted_spec.rb b/spec/lib/gitlab/ci/variables/collection/sorted_spec.rb index d85bf29f77f..954273fd41e 100644 --- a/spec/lib/gitlab/ci/variables/collection/sorted_spec.rb +++ b/spec/lib/gitlab/ci/variables/collection/sorted_spec.rb @@ -5,8 +5,11 @@ require 'spec_helper' RSpec.describe Gitlab::Ci::Variables::Collection::Sorted do describe '#errors' do context 'when FF :variable_inside_variable is disabled' do + let_it_be(:project_with_flag_disabled) { create(:project) } + let_it_be(:project_with_flag_enabled) { create(:project) } + before do - stub_feature_flags(variable_inside_variable: false) + stub_feature_flags(variable_inside_variable: [project_with_flag_enabled]) end context 'table tests' do @@ -53,7 +56,7 @@ RSpec.describe Gitlab::Ci::Variables::Collection::Sorted do end with_them do - subject { Gitlab::Ci::Variables::Collection::Sorted.new(variables) } + subject { Gitlab::Ci::Variables::Collection::Sorted.new(variables, project_with_flag_disabled) } it 'does not report error' do expect(subject.errors).to eq(nil) @@ -67,8 +70,11 @@ RSpec.describe Gitlab::Ci::Variables::Collection::Sorted do end context 'when FF :variable_inside_variable is enabled' do + let_it_be(:project_with_flag_disabled) { create(:project) } + let_it_be(:project_with_flag_enabled) { create(:project) } + before do - stub_feature_flags(variable_inside_variable: true) + stub_feature_flags(variable_inside_variable: [project_with_flag_enabled]) end context 'table tests' do @@ -100,7 +106,7 @@ RSpec.describe Gitlab::Ci::Variables::Collection::Sorted do end with_them do - subject { Gitlab::Ci::Variables::Collection::Sorted.new(variables) } + subject { Gitlab::Ci::Variables::Collection::Sorted.new(variables, project_with_flag_enabled) } it 'errors matches expected validation result' do expect(subject.errors).to eq(validation_result) @@ -164,7 +170,8 @@ RSpec.describe Gitlab::Ci::Variables::Collection::Sorted do end with_them do - subject { Gitlab::Ci::Variables::Collection::Sorted.new(variables) } + let_it_be(:project) { create(:project) } + subject { Gitlab::Ci::Variables::Collection::Sorted.new(variables, project) } it 'does not expand variables' do expect(subject.sort).to eq(variables) @@ -239,7 +246,8 @@ RSpec.describe Gitlab::Ci::Variables::Collection::Sorted do end with_them do - subject { Gitlab::Ci::Variables::Collection::Sorted.new(variables) } + let_it_be(:project) { create(:project) } + subject { Gitlab::Ci::Variables::Collection::Sorted.new(variables, project) } it 'sort returns correctly sorted variables' do expect(subject.sort.map { |var| var[:key] }).to eq(result) |