Module: RailsFeatureFlip::TestHelper
- Defined in:
- lib/rails_feature_flip/test_helper.rb
Overview
Test helper for temporarily overriding feature values in tests.
Instance Method Summary collapse
-
#with_feature(name, **overrides) { ... } ⇒ Object
Temporarily overrides attributes on a feature and restores them after the block.
Instance Method Details
#with_feature(name, **overrides) { ... } ⇒ Object
Temporarily overrides attributes on a feature and restores them after the block.
22 23 24 25 26 27 28 |
# File 'lib/rails_feature_flip/test_helper.rb', line 22 def with_feature(name, **overrides) feature = Rails.configuration.x.features.public_send(name) originals = save_feature_state(feature, overrides) yield ensure restore_feature_state(feature, originals) end |