mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-08-05 00:29:56 +02:00
feat: deleting a user upload dissociates from posts, and vice versa
This commit is contained in:
@@ -207,6 +207,16 @@ describe('upload methods', () => {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should remove the image\'s user association, if present', async () => {
|
||||
_recreateFiles();
|
||||
await posts.uploads.associate(pid, 'files/wut.txt');
|
||||
await user.associateUpload(uid, 'files/wut.txt');
|
||||
await posts.uploads.dissociate(pid, 'files/wut.txt');
|
||||
|
||||
const userUploads = await db.getSortedSetMembers(`uid:${uid}:uploads`);
|
||||
assert.strictEqual(userUploads.includes('files/wut.txt'), false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('.dissociateAll()', () => {
|
||||
|
||||
Reference in New Issue
Block a user