-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preserve the url hash when changing locales.
To implement this, I had to write a custom javascript handler to handle switching locales. Previously, this was handled for us via Rails's unobtrusive javascript, but I could not find any way to add in additional url parameters to the PATCH request the unobtrusive javascript was generating for us. There's actually an open PR from 2013 to implement support for this here: rails/jquery-ujs#307. I also rewrote the set_locale_spec to enable javascript and be more like what I believe a feature spec should be. I actually don't understand how the spec was even passing before, I would expect it to fail because it was sending a GET request, and we don't have a handler for GET request to update the locale. Maybe rspec/capybara/poltergiest has baked in support for unobtrusive javascript so that the right thing will happen even if you don't have javascript enabled?? That sounds crazy, but it's the only thing I can think of. Regardless of how this was working before, I do believe that the new specs are better. This fixes #2962.
- Loading branch information
Showing
7 changed files
with
68 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters