       done()
 
   context 'with end command as option', ->
-    before (done) ->
-      option = 'end'
-      done()
-
     beforeEach ->
-      server.inject(method: 'POST', url: '/', payload: payload('begin', channel_id) )
-        .then ->
-          server.inject(method: 'POST', url: '/', payload: payload(5, channel_id) )
-        .then ->
-          server.inject(method: 'POST', url: '/', payload: payload(3, channel_id) )
-        .then ->
-          server.inject(method: 'POST', url: '/', payload: payload(8, channel_id) )
+      server.inject(method: 'POST', url: '/', payload: payload('begin', 'calculate') )
+        .then ->
+          server.inject(method: 'POST', url: '/', payload: payload(5, 'calculate') )
+        .then ->
+          server.inject(method: 'POST', url: '/', payload: payload(3, 'calculate') )
+        .then ->
+          server.inject(method: 'POST', url: '/', payload: payload(8, 'calculate') )
+        .then ->
+          server.inject(method: 'POST', url: '/', payload: payload('end', 'calculate') )
+        .then (@res) =>
 
     it 'returns a 200 (success) status', (done) ->
       expect(@res.statusCode).to.equal 200

describe 'Index Route', ->
  option = null
  channel_id = 'C2147483705'

  payload = (option, channel_id) ->
    token: 'd74735605d5e35f005c09054c2f6684c'
    team_id: 'T0001'
    team_domain: 'example'

    req =
      method: 'POST'
      url: '/'
      payload: payload(option)

    server.inject(req).then (@res) =>

