Merge master into nod-queue

This commit is contained in:
David Erwin
2016-11-08 13:05:31 -05:00
+16 -21
View File
@@ -32,29 +32,24 @@ describe('GET /settings', () => {
// update the settings.
describe('update settings', () => {
it('should respond ok to a PUT', () => {
return Setting.update({id: '1'}, {$setOnInsert: defaults}, {upsert: true})
.then(() => {
return chai.request(app)
.put('/api/v1/settings')
.send({moderation: 'post'})
.then(res => {
expect(res).to.have.status(204);
before(() => {
return Setting.update({id: '1'}, {$setOnInsert: defaults}, {upsert: true});
});
return Setting.getSettings();
it('should respond to a PUT with new settings', () => {
chai.request(app)
.put('/api/v1/settings')
.send({moderation: 'post'}, (err, res) => {
expect(err).to.be.null;
expect(res).to.have.status(204);
done(err);
});
});
it('should have updates settings', () => {
chai.request(app)
.get('/api/v1/settings')
.end((err, res) => {
expect(err).to.be.null;
expect(res).to.have.status(200);
expect(res).to.be.json;
expect(res.body).to.have.property('moderation', 'post');
}).then(settings => {
// confirm updated settings in db
expect(settings).to.have.property('moderation');
expect(settings.moderation).to.equal('post');
}).catch(err => {
throw err;
});
});
});
});