Skip to content

Commit

Permalink
failing api test on repost / re-add, for #62
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienjoly committed Jul 20, 2017
1 parent add01ac commit 597bdf0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion whydJS/app/models/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ exports.rePost = function (pId, repostObj, handler) {
});
notifyMentionedUsers(result);
}
handler(result);
handler(result); // TODO : response.ops[0] should be returned instead => failing API test
});
})
}
Expand Down
16 changes: 15 additions & 1 deletion whydJS/test/api/post.api.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,22 @@ describe(`post api`, function() {
});
});
});

it(`should allow re-adding a track (aka "repost")`, function (done) {
api.loginAs(TEST_USER, function(error, { response, body, jar }) {
api.addPost(jar, { pId }, function(error, { response, body }) {
console.log('REPOST =>', error || body);
assert.ifError(error);
assert(body._id);
assert.notEqual(body._id, pid);
assert.equal(body.pId, pid);
assert.equal(body.eId, post.eId);
assert.equal(body.name, post.name);
done();
});
});
});

// TODO: same for repost
// TODO: update post
// TODO: delete post

Expand Down

0 comments on commit 597bdf0

Please sign in to comment.