Sha256: a57ce66c4533b928115f9757e26528353d09fc747849a186600df4c278e8037c

Contents?: true

Size: 784 Bytes

Versions: 8

Compression:

Stored size: 784 Bytes

Contents

module Spree
  module Core
    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
          Spree::Preferences::Store.instance.persistence = false
          config = Rails.application.config.spree.preferences
          config.reset
          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
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
spree_core-1.2.4 lib/spree/core/testing_support/preferences.rb
spree_core-1.2.3 lib/spree/core/testing_support/preferences.rb
spree_core-1.3.1 lib/spree/core/testing_support/preferences.rb
spree_core-1.3.0 lib/spree/core/testing_support/preferences.rb
spree_core-1.3.0.rc2 lib/spree/core/testing_support/preferences.rb
dup_spree_core-1.3.0.rc1 lib/spree/core/testing_support/preferences.rb
spree_core-1.3.0.rc1 lib/spree/core/testing_support/preferences.rb
spree_core-1.2.2 lib/spree/core/testing_support/preferences.rb