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:
authorRémy Coutable <remy@rymai.me>2016-12-07 13:31:21 +0300
committerRémy Coutable <remy@rymai.me>2016-12-07 13:31:21 +0300
commit5186618bb0220383ae4668b7d023bfbbb52c8948 (patch)
tree50364478658b52192e16fabec2a7326c827b28e4 /spec/models/ci
parent9f8a389ac6c2065e8b4fdf174af18c93ba398d25 (diff)
parent4e249d5baea99a52915025fc2827d01ab2d77c18 (diff)
Merge branch '25209-improve-length-validators' into 'master'
Use :maximum instead of :within for length validators with a 0..N range Closes #25209 See merge request !7894
Diffstat (limited to 'spec/models/ci')
-rw-r--r--spec/models/ci/variable_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/models/ci/variable_spec.rb b/spec/models/ci/variable_spec.rb
index 4e7833c3162..bee9f714849 100644
--- a/spec/models/ci/variable_spec.rb
+++ b/spec/models/ci/variable_spec.rb
@@ -5,6 +5,13 @@ describe Ci::Variable, models: true do
let(:secret_value) { 'secret' }
+ it { is_expected.to validate_presence_of(:key) }
+ it { is_expected.to validate_uniqueness_of(:key).scoped_to(:gl_project_id) }
+ it { is_expected.to validate_length_of(:key).is_at_most(255) }
+ it { is_expected.to allow_value('foo').for(:key) }
+ it { is_expected.not_to allow_value('foo bar').for(:key) }
+ it { is_expected.not_to allow_value('foo/bar').for(:key) }
+
before :each do
subject.value = secret_value
end