1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-24 23:23:36 +00:00
Files
homebrewery/test/brew.apitest.js
2017-01-22 12:46:16 -05:00

31 lines
667 B
JavaScript

const should = require('chai').use(require('chai-as-promised')).should();
const request = require('supertest-as-promised');
const app = require('../server.js');
const apiPath = '/api/brew';
describe(apiPath, () => {
describe('POST', () => {
it('creates a new brew', () => {
return request(app)
.post(apiPath)
.send({
text : 'Brew Text'
})
.expect(200)
.then((res) => {
const brew = res.body;
should.exist(brew);
brew.should.have.property('editId').that.is.a('string');
brew.should.have.property('shareId').that.is.a('string');
brew.should.have.property('text').that.is.a('string');
})
});
});
});