-
-
Notifications
You must be signed in to change notification settings - Fork 729
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
Replace use of spree.root_path and root_url with main_app.root_path and main_app.root_url #4635
Replace use of spree.root_path and root_url with main_app.root_path and main_app.root_url #4635
Conversation
… root path will no longer be defined when spree_backend is dropped
This fixes a broken spec with error "No route matches {:controller=>"home"}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good but Code Climate is still not happy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
The build is failing after you added those minor changes for CodeClimate. The added newlines are altering the test's expectation of what the string should be:
expected: "The hub you have selected is temporarily closed for orders. Please try again later."
got: "The hub you have selected is temporarily closed for orders.\n Please try again later."
… one line length issue
45293e0
to
5fccd5f
Compare
sorry, I forgot to check the build after pushing. |
Ping @luisramos0 Fancy unpicking the code climate issue? |
the codeclinate issue will be ignored. it's application_controller being too long... not easy at all. this is ready for testing. |
Tested: All behaved as expected. |
What? Why?
Continues #4595
This change will enable us to stop depending on spree_backend and some of the base spree routes that come with it.
Here I also adapt an unnecessary call to a devise method related to routes in after_sign_in_path_for. This was breaking the build without spree_backend.
What should we test?
I dont think we need to test all the changes to main_app.root_path.
I suggest we validate manually the change in after_sign_in_path_for by testing the redirection process after login:
1 - type domain/admin directly on the browser, like https://staging.openfoodnetwork.org.au/admin
2 - logout if you are logged in and repeat step 1
3 - after step 2 you will see the login box
4 - login
5 - expect to land in the backoffice at /admin
Release notes
Changelog Category: Changed
Switched some routes from spree base routes to ofn (main_app) routes to enable removing spree_backend dependency.