         notify:true
       }
 
-      api.post('/incidents', json).reply(400, {})
+      api.post('/incidents', json).reply(400)
 
       helper.converse @robot, @user, '/incident fixed on foo: msg', (envelope, response) ->
         assert.include response, 'The request to the API has failed (status code = 400)'
         done()
+
+  describe 'cachet status <red|orange|blue|green> <component name>', ->
+    it 'should allow to update a component status', (done) ->
+      helper.converse @robot, @user, '/cachet component set foo 3', (envelope, response) ->
+        assert.include response, 'The component \'foo\' (id = 3) has been set'
+
+      api.put('/components/3', { status: 4 }).reply(200, { data: {
+        name: 'foo',
+        status_name: 'new status'
+      }})
+
+      helper.converse @robot, @user, '/cachet status red foo', (envelope, response) ->
+        assert.equal response, 'foo status changed to: *new status*'
+        done()
+
+    it 'should deal with API errors', (done) ->
+      helper.converse @robot, @user, '/cachet component set foo 3', (envelope, response) ->
+        assert.include response, 'The component \'foo\' (id = 3) has been set'
+
+      api.put('/components/3', { status: 2 }).reply(409)
+
+      helper.converse @robot, @user, '/cachet status blue foo', (envelope, response) ->
+        assert.equal response, 'The request to the API has failed (status code = 409)'
+        done()

  it 'should be included in /help', ->
    assert.include @robot.commands[0], 'cachet'

  describe 'component list', ->
    it 'should say when there are no components registered', (done) ->
      helper.converse @robot, @user, '/cachet component list', (envelope, response) ->
        assert.include response, 'No component found'
        done()

  describe 'component set <component name> <id>', ->
    it 'should register components', (done) ->
      helper.converse @robot, @user, '/cachet component set foo 1', (envelope, response) ->
        assert.include response, 'The component \'foo\' (id = 1) has been set'

        done()

    it 'should deal with API errors', (done) ->
      api.get('/components').reply(500)

      helper.converse @robot, @user, '/cachet component status', (envelope, response) ->
        assert.equal response, 'The request to the API has failed (status code = 500)'
