Fix CurrentUser issue with tests

For some tests, the current user wasn't set by the time the CurrentUser
variable was used in several of the models.
This commit is contained in:
BrokenEagle
2020-07-19 03:58:02 +00:00
parent b2a2c4e140
commit e34e7b0d90
2 changed files with 3 additions and 3 deletions

View File

@@ -25,7 +25,7 @@ class PostVote < ApplicationRecord
end
def initialize_attributes
self.user_id ||= CurrentUser.user.id
self.user_id ||= CurrentUser.id
if vote == "up"
self.score = 1