fix scenarioManager and getUrl tests

This commit is contained in:
Joe Fleming 2015-11-05 17:36:15 -07:00
parent 48550f932b
commit e05e91bcd4
2 changed files with 33 additions and 5 deletions

View file

@ -108,12 +108,40 @@ describe('scenario manager', function () {
});
});
it('should throw an error if the scenario is not defined', function () {
expect(manager.load).withArgs('makelogs').to.throwError();
describe('load', function () {
it('should reject if the scenario is not specified', function () {
return manager.load()
.then(function () {
throw new Error('Promise should reject')
})
.catch(function () { return; });
});
it('should reject if the scenario is not defined', function () {
return manager.load('idonotexist')
.then(function () {
throw new Error('Promise should reject')
})
.catch(function () { return; });
});
});
it('should throw an error if an index is not defined when clearing', function () {
expect(manager.unload).to.throwError();
describe('unload', function () {
it('should reject if the scenario is not specified', function () {
return manager.unload()
.then(function () {
throw new Error('Promise should reject')
})
.catch(function () { return; });
});
it('should reject if the scenario is not defined', function () {
return manager.unload('idonotexist')
.then(function () {
throw new Error('Promise should reject')
})
.catch(function () { return; });
});
});
it('should throw an error if an es server is not specified', function () {

View file

@ -10,7 +10,7 @@ describe('getUrl', function () {
pathname: 'foo'
});
expect(url).to.be('http://localhost:9220/foo');
expect(url).to.be('http://localhost/foo');
});
it('should convert to a secure url with port', function () {