2017-07-13 03:58:05 -04:00
|
|
|
module StubFeatureFlags
|
2018-08-20 14:52:56 -04:00
|
|
|
# Stub Feature flags with `flag_name: true/false`
|
|
|
|
#
|
|
|
|
# @param [Hash] features where key is feature name and value is boolean whether enabled or not
|
2017-07-13 03:58:05 -04:00
|
|
|
def stub_feature_flags(features)
|
|
|
|
features.each do |feature_name, enabled|
|
2018-09-04 14:34:37 -04:00
|
|
|
allow(Feature).to receive(:enabled?).with(feature_name, any_args) { enabled }
|
|
|
|
allow(Feature).to receive(:enabled?).with(feature_name.to_s, any_args) { enabled }
|
2017-07-13 03:58:05 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|