push
0 of 1 new or added line in 1 file covered. (0.0%)
6774 existing lines in 129 files now uncovered.1939 of 15613 relevant lines covered (12.42%)
0.25 hits per line
UNCOV
1
|
class PasswordReset < ApplicationRecord |
× |
UNCOV
2
|
validates :user_email, presence: true |
× |
3 |
# attr_accessible :user_email, :token
|
|
UNCOV
4
|
def self.save_token(user, token) |
× |
UNCOV
5
|
password_reset = PasswordReset.find_by(user_email: user.email) |
× |
UNCOV
6
|
if password_reset
|
× |
UNCOV
7
|
password_reset.token = Digest::SHA1.hexdigest(token) |
× |
UNCOV
8
|
password_reset.save! |
× |
UNCOV
9
|
else
|
× |
UNCOV
10
|
PasswordReset.create(user_email: user.email, token: Digest::SHA1.hexdigest(token)) |
× |
UNCOV
11
|
end
|
× |
UNCOV
12
|
end
|
× |
UNCOV
13
|
end
|
× |