mirror of
https://github.com/wassname/talk.git
synced 2026-08-12 12:30:39 +08:00
Remove a test.
This commit is contained in:
+1
-1
@@ -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,
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user