mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 10:12:32 +08:00
DEV: Stabilize watched words order (#17215)
Fixes a flaky spec: ``` 1) WordWatcher.word_matcher_regexp format of the result regexp is correct when watched_words_regular_expressions = true Failure/Error: expect(regexp.inspect).to eq("/(#{word1})|(#{word2})/i") expected: "/(word35)|(word36)/i" got: "/(word36)|(word35)/i" (compared using ==) # ./spec/services/word_watcher_spec.rb:19:in `block (4 levels) in <main>' ```
This commit is contained in:
parent
16550537d0
commit
20e34b5da6
|
@ -21,6 +21,7 @@ class WordWatcher
|
|||
words = WatchedWord
|
||||
.where(action: WatchedWord.actions[action.to_sym])
|
||||
.limit(WatchedWord::MAX_WORDS_PER_ACTION)
|
||||
.order(:id)
|
||||
|
||||
if WatchedWord.has_replacement?(action.to_sym)
|
||||
words.pluck(:word, :replacement).to_h
|
||||
|
|
Loading…
Reference in New Issue
Block a user