summaryrefslogtreecommitdiff
path: root/spec/graphql/features/feature_flag_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 09:55:51 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 09:55:51 +0000
commite8d2c2579383897a1dd7f9debd359abe8ae8373d (patch)
treec42be41678c2586d49a75cabce89322082698334 /spec/graphql/features/feature_flag_spec.rb
parentfc845b37ec3a90aaa719975f607740c22ba6a113 (diff)
downloadgitlab-ce-e8d2c2579383897a1dd7f9debd359abe8ae8373d.tar.gz
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'spec/graphql/features/feature_flag_spec.rb')
-rw-r--r--spec/graphql/features/feature_flag_spec.rb21
1 files changed, 16 insertions, 5 deletions
diff --git a/spec/graphql/features/feature_flag_spec.rb b/spec/graphql/features/feature_flag_spec.rb
index 30238cf9cb3..e5560fccf89 100644
--- a/spec/graphql/features/feature_flag_spec.rb
+++ b/spec/graphql/features/feature_flag_spec.rb
@@ -28,14 +28,25 @@ RSpec.describe 'Graphql Field feature flags' do
end
end
- it 'returns the value when feature is enabled' do
- expect(subject['item']).to eq('name' => test_object.name)
+ it 'checks YAML definition for default_enabled' do
+ # Exception is indicative of a check for YAML definition
+ expect { subject }.to raise_error(Feature::InvalidFeatureFlagError, /The feature flag YAML definition for '#{feature_flag}' does not exist/)
end
- it 'returns nil when the feature is disabled' do
- stub_feature_flags(feature_flag => false)
+ context 'skipping YAML check' do
+ before do
+ skip_default_enabled_yaml_check
+ end
+
+ it 'returns the value when feature is enabled' do
+ expect(subject['item']).to eq('name' => test_object.name)
+ end
- expect(subject).to be_nil
+ it 'returns nil when the feature is disabled' do
+ stub_feature_flags(feature_flag => false)
+
+ expect(subject).to be_nil
+ end
end
end
end