Users with no email_tokens return true from email_confirmed
This commit is contained in:
parent
4668cf1d54
commit
238032051e
|
@ -381,7 +381,7 @@ class User < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def email_confirmed?
|
def email_confirmed?
|
||||||
email_tokens.where(email: self.email, confirmed: true).present?
|
email_tokens.where(email: self.email, confirmed: true).present? or email_tokens.count == 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -638,7 +638,7 @@ describe User do
|
||||||
it 'should return false' do
|
it 'should return false' do
|
||||||
user.email_tokens.each {|t| t.destroy}
|
user.email_tokens.each {|t| t.destroy}
|
||||||
user.reload
|
user.reload
|
||||||
user.email_confirmed?.should be_false
|
user.email_confirmed?.should be_true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue