Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit 0261060

Browse files
committed
Expose #105
1 parent aca6e75 commit 0261060

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/services/contributions.test.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,29 @@ describe('\'contributions\' service', () => {
8181
assert.ok(notification.relatedContributionId, 'has relatedContributionId');
8282
assert.equal(notification.relatedContributionId, contribution._id, 'has correct relatedContributionId');
8383
});
84+
85+
context('given soft-deleted contribution', () => {
86+
const contributionAttributes = {
87+
title: 'title',
88+
type: 'post',
89+
content: 'blah',
90+
language: 'en',
91+
};
92+
93+
beforeEach(async () => {
94+
const deletedContributionAttributes = Object.assign({}, contributionAttributes, {
95+
deleted: true,
96+
slug: 'title'
97+
});
98+
await service.create(deletedContributionAttributes, params);
99+
});
100+
101+
it('increments title slug', async () => {
102+
let contribution = await service.create(contributionAttributes, params);
103+
assert.ok(contribution, 'created contribution');
104+
assert.equal(contribution.slug, 'title1');
105+
});
106+
});
84107
});
85108

86109
describe('contributions patch', () => {

0 commit comments

Comments
 (0)