update tests

This commit is contained in:
terakilobyte
2015-06-11 15:18:37 -04:00
parent 4d8ab0a915
commit 3115ba6404
4 changed files with 3 additions and 43 deletions

View File

@ -97,6 +97,7 @@
"gulp-inject": "~1.0.2",
"gulp-nodemon": "^2.0.3",
"loopback-explorer": "^1.7.2",
"loopback-testing": "^1.1.0",
"mocha": "~2.0.1",
"multiline": "~1.0.1",
"supertest": "~0.15.0"

View File

@ -2,6 +2,7 @@
"restApiRoot": "/api",
"host": "0.0.0.0",
"port": 3000,
"legacyExplorer" : false,
"remoting": {
"context": {
"enableHttpContext": false

View File

@ -9,7 +9,7 @@ describe('GET /', function() {
});
});
describe('GET /login', function() {
describe('GET /signin', function() {
it('should return 200 OK', function(done) {
request(app)
.get('/login')

View File

@ -1,42 +0,0 @@
var chai = require('chai');
var should = chai.should();
var User = require('../models/User');
describe('User Model', function() {
it('should create a new user', function(done) {
var user = new User({
email: 'test@gmail.com',
password: 'password'
});
user.save(function(err) {
if (err) return done(err);
done();
});
});
it('should not create a user with the unique email', function(done) {
var user = new User({
email: 'test@gmail.com',
password: 'password'
});
user.save(function(err) {
if (err) err.code.should.equal(11000);
done();
});
});
it('should find user by email', function(done) {
User.findOne({ email: 'test@gmail.com' }, function(err, user) {
if (err) return done(err);
user.email.should.equal('test@gmail.com');
done();
});
});
it('should delete a user', function(done) {
User.remove({ email: 'test@gmail.com' }, function(err) {
if (err) return done(err);
done();
});
});
});