Repository navigation
Fix remaining order dependent translation specs - #2544
Merged
Merged
Conversation
Translations are ordered by title, and factory titles are sequence based. As in f6d0e2c, comparing them with an array in creation order fails for seeds where the sequence crosses from one digit to two between the entries, since "Entry 10" sorts before "Entry 9": https://github.com/codevise/pageflow/actions/runs/46627048745/job/142571428239 None of these examples is about the order, so compare the contained entries instead.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Translations are ordered by title, and factory titles come from a sequence. Specs that compare
translationswith an array in creation order fail for seeds where the sequence crosses from one digit to two between the entries, since "Entry 10" sorts before "Entry 9". f6d0e2c fixed this forDraftEntryandPublishedEntry; these three assertions were left:spec/controllers/admin/translations_controller_spec.rb: failed on master in https://github.com/codevise/pageflow/actions/runs/46627048745/job/142571428239 (seed 31824)spec/models/concerns/pageflow/translatable_spec.rb:#remove_from_translation_group sets translation group to nilanddestroying an entry does not destroy translation group with multiple entriesNone of these examples is about the order, so they now use
contain_exactly.Advancing the title sequence before each example (by 7 or 8 entries) makes each of the three examples fail on master and pass with this change.