Commit 2b90727c authored by Bob Van Landuyt's avatar Bob Van Landuyt

Change method signature to allow stubbing multiple features

parent e5f02b4c
module EE module EE
module LicenseHelpers module LicenseHelpers
def stub_feature(feature, enabled = true) # Enable/Disable a feature on the License for a spec.
#
# Example:
#
# stub_licensed_features(geo: true, deploy_board: false)
#
# This enables `geo` and disables `deploy_board` features for a spec.
# Other features are still enabled/disabled as defined in the licence.
def stub_licensed_features(features)
allow(License).to receive(:feature_available?).and_call_original allow(License).to receive(:feature_available?).and_call_original
features.each do |feature, enabled|
allow(License).to receive(:feature_available?).with(feature) { enabled } allow(License).to receive(:feature_available?).with(feature) { enabled }
end end
end end
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment