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:
Diffstat (limited to 'spec/lib/gitlab/ci/variables')
-rw-r--r--spec/lib/gitlab/ci/variables/builder/group_spec.rb18
-rw-r--r--spec/lib/gitlab/ci/variables/collection/item_spec.rb21
2 files changed, 22 insertions, 17 deletions
diff --git a/spec/lib/gitlab/ci/variables/builder/group_spec.rb b/spec/lib/gitlab/ci/variables/builder/group_spec.rb
index c3743ebd2d7..004e63f424f 100644
--- a/spec/lib/gitlab/ci/variables/builder/group_spec.rb
+++ b/spec/lib/gitlab/ci/variables/builder/group_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::Ci::Variables::Builder::Group do
+RSpec.describe Gitlab::Ci::Variables::Builder::Group, feature_category: :secrets_management do
let_it_be(:group) { create(:group) }
let(:builder) { described_class.new(group) }
@@ -185,21 +185,7 @@ RSpec.describe Gitlab::Ci::Variables::Builder::Group do
end
end
- context 'recursive' do
- before do
- stub_feature_flags(use_traversal_ids: false)
- end
-
- include_examples 'correct ancestor order'
- end
-
- context 'linear' do
- before do
- stub_feature_flags(use_traversal_ids: true)
- end
-
- include_examples 'correct ancestor order'
- end
+ include_examples 'correct ancestor order'
end
end
end
diff --git a/spec/lib/gitlab/ci/variables/collection/item_spec.rb b/spec/lib/gitlab/ci/variables/collection/item_spec.rb
index f7c6f7f51df..d96c8f1bd0c 100644
--- a/spec/lib/gitlab/ci/variables/collection/item_spec.rb
+++ b/spec/lib/gitlab/ci/variables/collection/item_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::Ci::Variables::Collection::Item do
+RSpec.describe Gitlab::Ci::Variables::Collection::Item, feature_category: :secrets_management do
let(:variable_key) { 'VAR' }
let(:variable_value) { 'something' }
let(:expected_value) { variable_value }
@@ -217,6 +217,25 @@ RSpec.describe Gitlab::Ci::Variables::Collection::Item do
end
end
+ describe '#masked?' do
+ let(:variable_hash) { { key: variable_key, value: variable_value } }
+ let(:item) { described_class.new(**variable_hash) }
+
+ context 'when :masked is not specified' do
+ it 'returns false' do
+ expect(item.masked?).to eq(false)
+ end
+ end
+
+ context 'when :masked is specified as true' do
+ let(:variable_hash) { { key: variable_key, value: variable_value, masked: true } }
+
+ it 'returns true' do
+ expect(item.masked?).to eq(true)
+ end
+ end
+ end
+
describe '#to_runner_variable' do
context 'when variable is not a file-related' do
it 'returns a runner-compatible hash representation' do