不要怂,就是干,撸起袖子干!

Commit ad10d9b6 by Daniel Durante

Fixed a spec test 'stores the current date in createdAt' since node is async our…

… times might be off slightly by a second or so when doing a comparison.
1 parent e89f13ab
Showing with 4 additions and 4 deletions
......@@ -709,10 +709,10 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
this.User.bulkCreate(data).success(function() {
self.User.findAll({order: 'id'}).success(function(users) {
expect(users.length).to.equal(2)
expect(users[0].username).to.equal("Peter")
expect(parseInt(+users[0].createdAt/5000, 10)).to.equal(parseInt(+new Date()/5000, 10))
expect(users[1].username).to.equal("Paul")
expect(parseInt(+users[1].createdAt/5000, 10)).to.equal(parseInt(+new Date()/5000, 10))
expect(users[0].username).to.equal('Peter')
expect(parseInt(+users[0].createdAt/5000, 10)).to.be.closeTo(parseInt(+new Date()/5000, 10), 1.5)
expect(users[1].username).to.equal('Paul')
expect(parseInt(+users[1].createdAt/5000, 10)).to.be.closeTo(parseInt(+new Date()/5000, 10), 1.5)
done()
})
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!