diff options
-rw-r--r-- | app/models/concerns/maskable.rb | 4 | ||||
-rw-r--r-- | spec/models/ci/build_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/concerns/maskable_spec.rb | 29 |
3 files changed, 2 insertions, 35 deletions
diff --git a/app/models/concerns/maskable.rb b/app/models/concerns/maskable.rb index 5c392f9deb3..8793f0ec965 100644 --- a/app/models/concerns/maskable.rb +++ b/app/models/concerns/maskable.rb @@ -16,10 +16,6 @@ module Maskable validates :value, format: { with: REGEX }, if: :masked? end - def masked? - masked || protected - end - def to_runner_variable super.merge(masked: masked?) end diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 20f44d07fad..88e12fa335d 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -2357,7 +2357,7 @@ describe Ci::Build do let(:ref) { Gitlab::Git::BRANCH_REF_PREFIX + build.ref } let(:protected_variable) do - { key: 'PROTECTED_KEY', value: 'protected_value', public: false, masked: true } + { key: 'PROTECTED_KEY', value: 'protected_value', public: false, masked: false } end before do @@ -2404,7 +2404,7 @@ describe Ci::Build do let(:ref) { Gitlab::Git::BRANCH_REF_PREFIX + build.ref } let(:protected_variable) do - { key: 'PROTECTED_KEY', value: 'protected_value', public: false, masked: true } + { key: 'PROTECTED_KEY', value: 'protected_value', public: false, masked: false } end before do diff --git a/spec/models/concerns/maskable_spec.rb b/spec/models/concerns/maskable_spec.rb index f3bc1e06754..0f2e2942e96 100644 --- a/spec/models/concerns/maskable_spec.rb +++ b/spec/models/concerns/maskable_spec.rb @@ -38,35 +38,6 @@ describe Maskable do end end - describe '#masked?' do - subject { variable.masked? } - - context 'when variable is masked' do - before do - variable.masked = true - end - - it { is_expected.to eq(true) } - end - - context 'when variable is protected' do - before do - variable.protected = true - end - - it { is_expected.to eq(true) } - end - - context 'when variable is not masked or protected' do - before do - variable.protected = false - variable.masked = false - end - - it { is_expected.to eq(false) } - end - end - describe '#to_runner_variable' do subject { variable.to_runner_variable } |