Fix 9248: challenge creator should not automatically join their own challenge (#10383)

* fix(challenges): creator should not join challenge automatically

* change behavior on the client side as well

* update tests and fix membercount

* update tests

* fix tests
This commit is contained in:
Matteo Pagliazzi
2018-05-25 12:03:39 +02:00
committed by GitHub
parent 9194e8226d
commit 6ef45a7fd2
33 changed files with 76 additions and 15 deletions

View File

@@ -65,6 +65,7 @@ describe('PUT /tasks/:id', () => {
fields for challenge tasks owned by a user`, async () => {
let guild = await generateGroup(user);
let challenge = await generateChallenge(user, guild);
await user.post(`/challenges/${challenge._id}/join`);
let challengeTask = await user.post(`/tasks/challenge/${challenge._id}`, {
type: 'daily',
@@ -198,6 +199,7 @@ describe('PUT /tasks/:id', () => {
});
let guild = await generateGroup(user);
let challenge = await generateChallenge(user, guild);
await user.post(`/challenges/${challenge._id}/join`);
await user.post('/user/webhook', {
url: `http://localhost:${server.port}/webhooks/${uuid}`,