gitlab-org--gitlab-foss/spec/support/stub_feature_flags.rb
Bob Van Landuyt 3ee48e422d Enable all feature flags by default in specs
Otherwise some features would go untested in non-specific contexts

I did need to disable the
`gitlab_git_diff_size_limit_increase`-feature in some specs since we
depend on diffs being expandable while the file we are testing on is
smaller than the increased limit.
2017-07-13 13:00:34 +02:00

8 lines
275 B
Ruby

module StubFeatureFlags
def stub_feature_flags(features)
features.each do |feature_name, enabled|
allow(Feature).to receive(:enabled?).with(feature_name) { enabled }
allow(Feature).to receive(:enabled?).with(feature_name.to_s) { enabled }
end
end
end