summaryrefslogtreecommitdiff
path: root/spec/models/concerns
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 18:18:33 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 18:18:33 +0000
commitf64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch)
treea2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /spec/models/concerns
parentbfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff)
downloadgitlab-ce-f64a639bcfa1fc2bc89ca7db268f594306edfd7c.tar.gz
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
Diffstat (limited to 'spec/models/concerns')
-rw-r--r--spec/models/concerns/ci/has_variable_spec.rb11
-rw-r--r--spec/models/concerns/project_features_compatibility_spec.rb4
2 files changed, 13 insertions, 2 deletions
diff --git a/spec/models/concerns/ci/has_variable_spec.rb b/spec/models/concerns/ci/has_variable_spec.rb
index b5390281064..e917ec6b802 100644
--- a/spec/models/concerns/ci/has_variable_spec.rb
+++ b/spec/models/concerns/ci/has_variable_spec.rb
@@ -11,6 +11,17 @@ RSpec.describe Ci::HasVariable do
it { is_expected.not_to allow_value('foo bar').for(:key) }
it { is_expected.not_to allow_value('foo/bar').for(:key) }
+ describe 'scopes' do
+ describe '.by_key' do
+ let!(:matching_variable) { create(:ci_variable, key: 'example') }
+ let!(:non_matching_variable) { create(:ci_variable, key: 'other') }
+
+ subject { Ci::Variable.by_key('example') }
+
+ it { is_expected.to contain_exactly(matching_variable) }
+ end
+ end
+
describe '#key=' do
context 'when the new key is nil' do
it 'strips leading and trailing whitespaces' do
diff --git a/spec/models/concerns/project_features_compatibility_spec.rb b/spec/models/concerns/project_features_compatibility_spec.rb
index 2059e170446..62c9a041a85 100644
--- a/spec/models/concerns/project_features_compatibility_spec.rb
+++ b/spec/models/concerns/project_features_compatibility_spec.rb
@@ -4,8 +4,8 @@ require 'spec_helper'
RSpec.describe ProjectFeaturesCompatibility do
let(:project) { create(:project) }
- let(:features_enabled) { %w(issues wiki builds merge_requests snippets) }
- let(:features) { features_enabled + %w(repository pages operations) }
+ let(:features_enabled) { %w(issues wiki builds merge_requests snippets security_and_compliance) }
+ let(:features) { features_enabled + %w(repository pages operations container_registry) }
# We had issues_enabled, snippets_enabled, builds_enabled, merge_requests_enabled and issues_enabled fields on projects table
# All those fields got moved to a new table called project_feature and are now integers instead of booleans