Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not reset spree preferences starting from v2.9 #22

Merged
merged 2 commits into from
Aug 8, 2019

Conversation

kennyadsl
Copy link
Member

@kennyadsl kennyadsl commented Jul 18, 2019

We need this to remove deprecation warnings into extensions. Of course, this could let some spec fail on 2.9 or master.

This PR stops resetting preferences after each spec run and provides an alternative method to use into extensions (and stores) specs. This method will work for all supported Solidus versions and it will be easy to remove later since they have the same signature: we can just remove the require 'solidus_support/testing_support/preferences' for solidus support rails_helper without any change in the extensions.

@kennyadsl kennyadsl self-assigned this Jul 18, 2019
@kennyadsl
Copy link
Member Author

@spaghetticode can you please review?

Copy link
Member

@spaghetticode spaghetticode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🍸
thank you @kennyadsl 👍

@kennyadsl kennyadsl changed the title Do not reset spree preferences starting from 2.9 Do not reset spree preferences starting from v2.9 Jul 18, 2019
@kennyadsl
Copy link
Member Author

Better to wait for solidusio/solidus#3275, which could change the signature of the stub_spree_preferences method.

Copy link

@ericsaupe ericsaupe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Using this method in extensions (and stores) allows to set preferences
by stubbing them as suggested in core. Using this helper guarantee to have
it working also in past Solidus versions, where stub_spree_preferences
method does not exist yet.
@kennyadsl
Copy link
Member Author

I tried this branch in a real extension (solidusio/solidus_auth_devise#166), waiting for the CI to run before merge here.

@kennyadsl kennyadsl merged commit 4682d18 into solidusio:master Aug 8, 2019
@kennyadsl kennyadsl deleted the kennyadsl/reset_preferences branch August 8, 2019 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants