fix test email for string

This commit is contained in:
Berkeley Martinez
2015-08-05 22:56:23 -07:00
parent 0ce81bbabb
commit ce9e2ebcae

View File

@ -48,7 +48,9 @@ module.exports = function(User) {
User.observe('before save', function({ instance: user }, next) { User.observe('before save', function({ instance: user }, next) {
if (user) { if (user) {
user.username = user.username.trim().toLowerCase(); user.username = user.username.trim().toLowerCase();
user.email = user.email.trim().toLowerCase(); user.email = typeof user.email === 'string' ?
user.email.trim().toLowerCase() :
user.email;
} }
next(); next();
}); });