summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2019-02-19 11:35:47 +0100
committerMatija Čupić <matteeyah@gmail.com>2019-02-19 12:00:12 +0100
commit3739a9e4c6bb1671b24035b87fdad2b032636e3d (patch)
tree93b6b660f528dd7b1d4633ca00cd7462ec097bd9
parente47812bdfe6612ede84bfd8343f900b6581e603a (diff)
downloadgitlab-ce-simple-masking-separated.tar.gz
Separate masked and protectedsimple-masking-separated
-rw-r--r--app/models/concerns/maskable.rb4
-rw-r--r--spec/models/ci/build_spec.rb4
-rw-r--r--spec/models/concerns/maskable_spec.rb29
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 }