FIX: Mentions updater should work regardless of .notify

This commit is contained in:
Robin Ward 2020-02-18 16:02:26 -05:00
parent 041168c9b6
commit 53054b41d2
2 changed files with 2 additions and 1 deletions

View File

@ -3,7 +3,7 @@
class GroupMentionsUpdater
def self.update(current_name, previous_name)
Post.where(
"cooked LIKE '%class=\"mention-group\"%' AND raw LIKE :previous_name",
"cooked LIKE '%class=\"mention-group%' AND raw LIKE :previous_name",
previous_name: "%@#{previous_name}%"
).find_in_batches do |posts|

View File

@ -28,6 +28,7 @@ RSpec.describe GroupMentionsUpdater do
group.update!(name: new_group_name)
post.reload
puts post.raw
expect(post.raw_mentions).to eq([new_group_name])
expect(post.raw).to eq(expected_raw)