Refactor tests

This commit is contained in:
Jonathan Cremin 2015-08-22 18:43:30 +01:00
parent 7e88b3281e
commit 25a3dfc456
2 changed files with 5 additions and 3 deletions

View file

@ -12,7 +12,7 @@ describe('hostr-api user', function() {
.get('/api/user')
.auth('test@hostr.co', 'test-password')
.expect(function(response) {
assert(response.body.id === '54fd04a37675bcd06213eac8');
assert(response.body.email === 'test@hostr.co');
})
.expect(200)
.end(done);

View file

@ -1,7 +1,9 @@
db.users.remove({
"email": "test@hostr.co"
});
db.users.save({
"_id": ObjectId("54fd04a37675bcd06213eac8"),
"email": "test@hostr.co",
"salted_password": "$pbkdf2-256-1$2$kBhIDRqFwnF/1ms6ZHfME2o2$a48e8c350d26397fcc88bf0a7a2817b1cdcd1ffffe0521a5",
"joined": 1425867940,
"joined": Math.ceil(Date.now()/1000),
"signup_ip": "127.0.0.1"
});