Skip to content

Instantly share code, notes, and snippets.

@bookercodes
Created October 28, 2015 01:16
Show Gist options
  • Save bookercodes/20f79c4e00caf70695a2 to your computer and use it in GitHub Desktop.
Save bookercodes/20f79c4e00caf70695a2 to your computer and use it in GitHub Desktop.
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