From 25a3dfc4561a1867aaf77db8f51685e86e48cc53 Mon Sep 17 00:00:00 2001 From: Jonathan Cremin Date: Sat, 22 Aug 2015 18:43:30 +0100 Subject: [PATCH] Refactor tests --- test/api/user.spec.js | 2 +- test/fixtures/mongo-user.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/api/user.spec.js b/test/api/user.spec.js index e68d14e..2efe77d 100644 --- a/test/api/user.spec.js +++ b/test/api/user.spec.js @@ -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); diff --git a/test/fixtures/mongo-user.js b/test/fixtures/mongo-user.js index 95595a6..9da07dd 100644 --- a/test/fixtures/mongo-user.js +++ b/test/fixtures/mongo-user.js @@ -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" });