added an in-channel publish test

This commit is contained in:
bill bittner 2017-12-21 09:37:22 -08:00
parent 1e8d9a32a7
commit e7bb724e5f

View file

@ -88,9 +88,11 @@ describe('end-to-end', function () {
const name = `test-publish-${date.getFullYear()}-${date.getMonth()}-${date.getDate()}-${date.getTime()}`;
const filePath = './test/mock-data/bird.jpeg';
const fileName = 'byrd.jpeg';
const channelName = '@testpublishchannel';
const channelPassword = 'password';
describe(publishUrl, function () {
it(`should receive a status code 200 within ${publishTimeout}ms @usesLbc`, function (done) {
it(`non-channel publishes should receive a status code 200 within ${publishTimeout}ms @usesLbc`, function (done) {
chai.request(host)
.post(publishUrl)
.type('form')
@ -104,6 +106,23 @@ describe('end-to-end', function () {
}).timeout(publishTimeout);
});
describe(publishUrl, function () {
it(`channel publishes should receive a status code 200 within ${publishTimeout}ms @usesLbc`, function (done) {
chai.request(host)
.post(publishUrl)
.type('form')
.attach('file', fs.readFileSync(filePath), fileName)
.field('name', name)
.field('channelName', channelName)
.field('channelPassword', channelPassword)
.end(function (err, res) {
// expect(err).to.be.null;
expect(res).to.have.status(200);
done();
});
}).timeout(publishTimeout);
});
});