Remove a test.

This commit is contained in:
gaba
2016-11-04 10:07:44 -07:00
parent 730bd29bd1
commit 7c3005be50
3 changed files with 12 additions and 23 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ const CommentSchema = new Schema({
body: {
type: String,
required: [true, 'The body is required.'],
minlength: 10
minlength: 2
},
asset_id: String,
author_id: String,
+7 -6
View File
@@ -1,6 +1,7 @@
/* eslint-env node, mocha */
require('../utils/mongoose');
const Comment = require('../../models/comment');
const expect = require('chai').expect;
@@ -8,13 +9,13 @@ describe('Comment: models', () => {
var mockComments;
beforeEach(() => {
return Comment.create([{
body: 'comment 1',
body: 'comment 10',
asset_id: '123'
},{
body: 'comment 2',
body: 'comment 20',
asset_id: '123'
},{
body: 'comment 3',
body: 'comment 30',
asset_id: '456'
}]).then((comments) => {
mockComments = comments;
@@ -25,7 +26,7 @@ describe('Comment: models', () => {
it('should find a comment by id', () => {
return Comment.findById(mockComments[0].id).then((result) => {
expect(result).to.have.property('body')
.and.to.equal('comment 1');
.and.to.equal('comment 10');
});
});
});
@@ -35,9 +36,9 @@ describe('Comment: models', () => {
return Comment.findByAssetId('123').then((result) => {
expect(result).to.have.length(2);
expect(result[0]).to.have.property('body')
.and.to.equal('comment 1');
.and.to.equal('comment 10');
expect(result[1]).to.have.property('body')
.and.to.equal('comment 2');
.and.to.equal('comment 20');
});
});
});
+4 -16
View File
@@ -2,23 +2,21 @@ require('../../../utils/mongoose');
const Action = require('../../../../models/action');
const User = require('../../../../models/user');
const Comment = require('../../../../models/comment');
const expect = require('chai').expect;
const streamRoutes = require('../../../../routes/api/stream');
describe('api/stream: routes', () => {
const comments = [{
id: 'abc',
body: 'comment 1',
body: 'comment 10',
asset_id: 'asset',
author_id: '123'
},{
id: 'def',
body: 'comment 2',
body: 'comment 20',
asset_id: 'asset',
author_id: '456'
},{
id: 'hij',
body: 'comment 3',
body: 'comment 30',
asset_id: '456'
}]
@@ -46,15 +44,5 @@ describe('api/stream: routes', () => {
})
})
it('should return a stream with comments, users and actions', () => {
streamRoutes('./')({
query: {
asset_id: 'asset'
}
}, {
json: (data) => {
expect(data).to.equal(1);
}
})
})
it('should return a stream with comments, users and actions')
})