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/models/ci/variable_spec.rb')
-rw-r--r--spec/models/ci/variable_spec.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/models/ci/variable_spec.rb b/spec/models/ci/variable_spec.rb
index 85327dbeb34..c93f355718a 100644
--- a/spec/models/ci/variable_spec.rb
+++ b/spec/models/ci/variable_spec.rb
@@ -15,13 +15,16 @@ RSpec.describe Ci::Variable, feature_category: :secrets_management do
it { is_expected.to include_module(Ci::Maskable) }
it { is_expected.to include_module(HasEnvironmentScope) }
it { is_expected.to validate_uniqueness_of(:key).scoped_to(:project_id, :environment_scope).with_message(/\(\w+\) has already been taken/) }
+ it { is_expected.to allow_values('').for(:description) }
+ it { is_expected.to allow_values(nil).for(:description) }
+ it { is_expected.to validate_length_of(:description).is_at_most(255) }
end
describe '.by_environment_scope' do
let!(:matching_variable) { create(:ci_variable, environment_scope: 'production ') }
let!(:non_matching_variable) { create(:ci_variable, environment_scope: 'staging') }
- subject { Ci::Variable.by_environment_scope('production') }
+ subject { described_class.by_environment_scope('production') }
it { is_expected.to contain_exactly(matching_variable) }
end