 80569dd5a9
			
		
	
	80569dd5a9
	
	
	
		
			
			The test descriptions now describe the expected logical outcome of the test, not the operation being done.
		
			
				
	
	
		
			37 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			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)
 | |
| });
 |