Postgres.

This commit is contained in:
Jonathan Cremin 2016-06-19 10:14:47 -07:00
parent 695644c260
commit 806f42e3f8
25 changed files with 501 additions and 294 deletions

27
test/fixtures/user.js vendored Normal file
View file

@ -0,0 +1,27 @@
import models from '../../models';
function createUser() {
models.user.create({
'email': 'test@hostr.co',
'password': '$pbkdf2-256-1$2$kBhIDRqFwnF/1ms6ZHfME2o2$a48e8c350d26397fcc88bf0a7a2817b1cdcd1ffffe0521a5',
'ip': '127.0.0.1',
'plan': 'Free',
'activated': true,
}).then((user) => {
user.save().then(() => {
models.sequelize.close();
});
});
}
models.user.findOne({
where: {
email: 'test@hostr.co',
},
}).then((user) => {
if (user) {
user.destroy().then(createUser);
} else {
createUser();
}
});