summaryrefslogtreecommitdiff
path: root/spec/graphql/features/feature_flag_spec.rb
diff options
context:
space:
mode:
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