MaxScale/maxctrl/test/states.js
Markus Mäkelä 80569dd5a9 MXS-1300: Correct test case descriptions
The test descriptions now describe the expected logical outcome of the
test, not the operation being done.
2017-08-09 11:39:25 +03:00

37 lines
1.0 KiB
JavaScript

require('../test_utils.js')()
describe("Set/Clear Commands", function() {
before(function() {
return startMaxScale()
.then(function() {
return request.put(host + 'monitors/MySQL-Monitor/stop')
})
})
it('set correct state', function() {
return verifyCommand('set server server2 master', 'servers/server2')
.then(function(res) {
res.data.attributes.state.should.match(/Master/)
})
})
it('clear correct state', function() {
return verifyCommand('clear server server2 master', 'servers/server2')
.then(function(res) {
res.data.attributes.state.should.not.match(/Master/)
})
})
it('reject set incorrect state', function() {
return doCommand('set server server2 something')
.should.be.rejected
})
it('reject clear incorrect state', function() {
return doCommand('clear server server2 something')
.should.be.rejected
})
after(stopMaxScale)
});