Fix test helper method stub_licensed_features for JH features
What does this Issue do
stub_licensed_features
is a helper method that helps mock feature license in test environment.
For feature license added only in JH, it will throw an ArgumentError
that the feature license doesn't exist.
Proposal
stub_licensed_features
depends on GitlabSubscriptions::Features::ALL_FEATURES
.
Re-define ALL_FEATURES
in JH to allow JH specific features to be found.
ee/spec/support/helpers/ee/license_helpers.rb
def stub_licensed_features(features)
missing_features = features.keys.map(&:to_sym) - GitlabSubscriptions::Features::ALL_FEATURES
if missing_features.any?
subject = missing_features.join(', ')
noun = 'feature'.pluralize(missing_features.size)
raise ArgumentError, "#{subject} should be defined as licensed #{noun}"
end
# ...
cc EM @prajnamas