retreiving comments based on settings was backwards

This commit is contained in:
Riley Davis
2016-11-29 12:16:51 -07:00
parent 5485a446f3
commit 9fcd7b8d3a
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ router.get('/', (req, res, next) => {
// Fetch the appropriate comments stream.
let comments;
if (settings.moderation === 'post') {
if (settings.moderation === 'pre') {
comments = Comment.findAcceptedByAssetId(asset.id);
} else {
comments = Comment.findAcceptedAndNewByAssetId(asset.id);
+4 -4
View File
@@ -17,7 +17,7 @@ describe('/api/v1/stream', () => {
const settings = {
id: '1',
moderation: 'pre'
moderation: 'post'
};
const comments = [{
@@ -73,7 +73,7 @@ describe('/api/v1/stream', () => {
.findOrCreateByUrl('http://coralproject.net/asset2')
.then((asset) => {
return Asset
.overrideSettings(asset.id, {moderation: 'post'})
.overrideSettings(asset.id, {moderation: 'pre'})
.then(() => asset);
})
])
@@ -108,7 +108,7 @@ describe('/api/v1/stream', () => {
expect(res.body.comments.length).to.equal(2);
expect(res.body.users.length).to.equal(2);
expect(res.body.actions.length).to.equal(1);
expect(res.body.settings).to.have.property('moderation', 'pre');
expect(res.body.settings).to.have.property('moderation', 'post');
});
});
@@ -121,7 +121,7 @@ describe('/api/v1/stream', () => {
expect(res.body.assets.length).to.equal(1);
expect(res.body.comments.length).to.equal(1);
expect(res.body.users.length).to.equal(1);
expect(res.body.settings).to.have.property('moderation', 'post');
expect(res.body.settings).to.have.property('moderation', 'pre');
});
});
});