Created
October 28, 2015 01:16
-
-
Save bookercodes/20f79c4e00caf70695a2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it ("should store user in the database", function(done) { | |
const model = { | |
username: "username", | |
email: "[email protected]", | |
password: "password123" | |
}; | |
request(server.app) | |
.post("/users") | |
.send(model) | |
.expect(201) | |
.end(function(err, res) { | |
orm | |
.models | |
.User | |
.findOne({ | |
where: { | |
username: model.username | |
} | |
}) | |
.then(function(user) { | |
expect(user).to.exist; | |
user = user.dataValues; | |
expect(user.id).to.exist; | |
expect(user.username).to.equal(model.username); | |
expect(user.password).to.not.equal(model.password); | |
done(); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment