Sha256: 421ed84b3789a0bbcf92b7cdd45961d71fd768037fb2e8893ee1ae314113aec7
Contents?: true
Size: 948 Bytes
Versions: 9
Compression:
Stored size: 948 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.site_name = "my fancy pants store" # 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
9 entries across 9 versions & 1 rubygems