fix tests

This commit is contained in:
Albert Yi
2018-05-09 11:56:01 -07:00
parent 81d94dbab9
commit 99012ff342
13 changed files with 33 additions and 12 deletions

View File

@@ -255,8 +255,8 @@ class Dmail < ApplicationRecord
end
def mark_as_read!
update_column(:is_read, true)
owner.dmails.unread.count.tap do |unread_count|
update_column(:is_read, true)
owner.update(has_mail: (unread_count > 0), unread_dmail_count: unread_count)
end
end

View File

@@ -564,7 +564,7 @@ class Post < ApplicationRecord
if PostKeeperManager.enabled? && persisted?
# no need to do this check on the initial create
PostKeeperManager.check_and_update(self, CurrentUser.id, increment_tags)
PostKeeperManager.check_and_assign(self, CurrentUser.id, increment_tags)
# run this again async to check for race conditions
PostKeeperManager.queue_check(self, CurrentUser.id)