-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rails main / 7.1.0.alpha introduced a change to improve typography by default, by converting all apostrophes to be single quotation marks. rails/rails#45463 The change caused all our text based matching to fail, this updates the tests to ensure compatibility. Model tests were changed to test against the error type & information rather than the translated string, which I think is an improvement overall that should make them a little less brittle. I thought of using [of_kind?] but that isn't available on all Rails versions we currently support, while `added?` is. The drawback is that `added?` require full details like the `:confirmation` example which requires the related attribute that is being confirmed, but that's a small price to pay. Integration tests were changed to match on a regexp that accepts both quotes. I could've used a simple `.` to match anything there, but thought I'd just keep it specific for clarity on what it is really expected to match there. Plus, since it's integration testing against a rendered response body, it's better to match the actual text rather than resort on other ways. (like using I18n directly, etc.) [of_kind?] https://api.rubyonrails.org/classes/ActiveModel/Errors.html#method-i-of_kind-3F
- Loading branch information
1 parent
afec665
commit 232c855
Showing
9 changed files
with
32 additions
and
32 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
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