Sha256: b7905fbbf1782556da6bf6a7e12b7363caf4d2a8da01fa74fd78d85e32c85b4c
Contents?: true
Size: 943 Bytes
Versions: 122
Compression:
Stored size: 943 Bytes
Contents
module Spree module TestingSupport module Preferences # Resets all preferences to default values, you can # pass a block to override the defaults with a block # # reset_spree_preferences do |config| # config.track_inventory_levels = false # end # def reset_spree_preferences(&config_block) Spree::Preferences::Store.instance.persistence = false Spree::Preferences::Store.instance.clear_cache config = Rails.application.config.spree.preferences configure_spree_preferences &config_block if block_given? end def configure_spree_preferences config = Rails.application.config.spree.preferences yield(config) if block_given? end def assert_preference_unset(preference) find("#preferences_#{preference}")['checked'].should be false Spree::Config[preference].should be false end end end end
Version data entries
122 entries across 122 versions & 1 rubygems