Code cleanup related to old tag services

This commit is contained in:
Wyatt Johnson
2017-05-11 14:56:36 -06:00
parent 899805b956
commit 0d957bcfb9
4 changed files with 110 additions and 134 deletions
-83
View File
@@ -219,89 +219,6 @@ describe('services.CommentsService', () => {
});
describe('#addTag', () => {
it('adds a tag', async () => {
const id = comments[0].id;
const name = 'BEST';
const assigned_by = users[0].id;
await CommentsService.addTag(id, {
tag: {
name
},
assigned_by
});
const {tags} = await CommentsService.findById(id);
expect(tags.length).to.equal(1);
expect(tags[0].tag.name).to.equal(name);
expect(tags[0].assigned_by).to.equal(assigned_by);
});
it('can\'t add same tag.id twice', async () => {
const id = comments[0].id;
const name = 'BEST';
const assigned_by = users[0].id;
await CommentsService.addTag(id, {
tag: {
name
},
assigned_by
});
{
let {tags} = await CommentsService.findById(id);
expect(tags.length).to.equal(1);
}
await CommentsService.addTag(id, {
tag: {
name
},
assigned_by
});
{
let {tags} = await CommentsService.findById(id);
expect(tags.length).to.equal(1);
}
});
});
describe('#removeTag', () => {
it('removes a tag', async () => {
const id = comments[0].id;
const name = 'BEST';
const assigned_by = users[0].id;
await CommentsService.addTag(id, {
tag: {
name
},
assigned_by
});
{
const {tags} = await CommentsService.findById(id);
expect(tags.length).to.equal(1);
}
// ok now to remove it
await CommentsService.removeTag(id, {
tag: {
name
},
assigned_by
});
{
const {tags} = await CommentsService.findById(id);
expect(tags.length).to.equal(0);
}
});
});
describe('#changeStatus', () => {
it('should change the status of a comment from no status', () => {