Skip to content

Commit

Permalink
Do not clear subscribers when resetting preferences
Browse files Browse the repository at this point in the history
Subscribers are loaded once at runtime during the app initialization
process, so if they get reset by `reset_spree_preferences` then the
original value will not come back.
  • Loading branch information
spaghetticode committed Sep 18, 2020
1 parent 0f9cd86 commit 2cfe4be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/lib/spree/testing_support/preferences.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ module Preferences
#
# @deprecated
def reset_spree_preferences(&config_block)
Spree::Config.instance_variables.each { |iv| Spree::Config.remove_instance_variable(iv) }
Spree::Config.instance_variables.
reject { |iv| iv == :@events_configuration }.
each { |iv| Spree::Config.remove_instance_variable(iv) }
Spree::Config.preference_store = Spree::Config.default_preferences

if defined?(Railties)
Expand Down

0 comments on commit 2cfe4be

Please sign in to comment.