Refactored form.server.model.test.js
This commit is contained in:
parent
efb6fa6d7f
commit
367e2df0ad
|
@ -6,16 +6,12 @@
|
|||
var should = require('should'),
|
||||
mongoose = require('mongoose'),
|
||||
User = mongoose.model('User'),
|
||||
Form = mongoose.model('Form'),
|
||||
Field = mongoose.model('Field'),
|
||||
_ = require('lodash'),
|
||||
config = require('../../config/config'),
|
||||
FormSubmission = mongoose.model('FormSubmission');
|
||||
Form = mongoose.model('Form');
|
||||
|
||||
/**
|
||||
* Globals
|
||||
*/
|
||||
var user, myForm, mySubmission;
|
||||
var user, myForm;
|
||||
|
||||
/**
|
||||
* Unit tests
|
||||
|
@ -34,8 +30,7 @@ describe('Form Model Unit Tests:', function() {
|
|||
|
||||
user.save(function(err) {
|
||||
if(err) {
|
||||
done(err);
|
||||
return;
|
||||
return done(err);
|
||||
}
|
||||
myForm = new Form({
|
||||
title: 'Form Title',
|
||||
|
@ -75,8 +70,7 @@ describe('Form Model Unit Tests:', function() {
|
|||
describe('Method Find', function(){
|
||||
beforeEach(function(done){
|
||||
myForm.save(function(err) {
|
||||
if(err) return done(err);
|
||||
done();
|
||||
return done(err);
|
||||
});
|
||||
});
|
||||
it('should be able to findOne my form without problems', function(done) {
|
||||
|
|
Loading…
Reference in a new issue