Initial commit of asset queuing (#97)

* Initial commit of asset queuing

* Addresssing comments
This commit is contained in:
Wyatt Johnson
2016-11-28 13:29:39 -05:00
committed by Dan Zajdband
parent c1a7b95705
commit b0f01cf00f
38 changed files with 832 additions and 408 deletions
-2
View File
@@ -1,5 +1,3 @@
require('../utils/mongoose');
const Action = require('../../models/action');
const expect = require('chai').expect;
-35
View File
@@ -1,7 +1,3 @@
/* eslint-env node, mocha */
require('../utils/mongoose');
const Asset = require('../../models/asset');
const expect = require('chai').expect;
@@ -74,35 +70,4 @@ describe('Asset: model', () => {
});
});
});
describe('#upsert', ()=> {
it('should insert an asset with no id', () => {
return Asset.upsert({url: 'http://newasset.test.com'})
.then((asset) => {
expect(asset).to.have.property('id');
});
});
it('should update an asset when the id exists', () => {
return Asset.upsert({id: 1, url: 'http://new.test.com'})
.then((asset) => {
expect(asset).to.have.property('id')
.and.to.equal('1');
expect(asset).to.have.property('url')
.and.to.equal('http://new.test.com');
});
});
});
describe('#removeAll', ()=> {
it('should insert an asset with no id', () => {
return Asset.removeAll({id:1})
.then(() => {
return Asset.findById(1);
})
.then((result) => {
expect(result).to.be.null;
});
});
});
});
-2
View File
@@ -1,5 +1,3 @@
require('../utils/mongoose');
const Comment = require('../../models/comment');
const User = require('../../models/user');
const Action = require('../../models/action');
-4
View File
@@ -1,7 +1,3 @@
/* eslint-env node, mocha */
require('../utils/mongoose');
const Setting = require('../../models/setting');
const expect = require('chai').expect;
-2
View File
@@ -1,5 +1,3 @@
require('../utils/mongoose');
const User = require('../../models/user');
const expect = require('chai').expect;