mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-27 21:06:49 +00:00
Check feature name in specs
There was one case where a typo meant that the desired feature wasn't active and tests were not testing the right code path. Using this new syntax should prevent that. * https://github.com/openfoodfoundation/openfoodnetwork/pull/11705
This commit is contained in:
@@ -92,7 +92,13 @@ RSpec.configure do |config|
|
||||
end
|
||||
|
||||
config.before(:each, :feature) do |example|
|
||||
Flipper.enable(example.metadata[:feature])
|
||||
feature = example.metadata[:feature].to_s
|
||||
|
||||
unless OpenFoodNetwork::FeatureToggle::CURRENT_FEATURES.key?(feature)
|
||||
raise "Unkown feature: #{feature}"
|
||||
end
|
||||
|
||||
Flipper.enable(feature)
|
||||
end
|
||||
|
||||
# Enable caching in any specs tagged with `caching: true`.
|
||||
|
||||
Reference in New Issue
Block a user