         error err, req, res, next
 
     it 'should respond 401', ->
-      res.send.should.have.been.calledWith 401
+      res.status.should.have.been.calledWith 401
 
     it 'should respond "Unauthorized"', ->
-      res.send.should.have.been.calledWith sinon.match.number, 'Unauthorized'
+      send.should.have.been.calledWith 'Unauthorized'
 
     it 'should challenge to authenticate', ->
       res.headers['WWW-Authenticate'].should.be.defined

      res.headers['Pragma'].should.equal 'no-cache'

    it 'should provide an error', ->
      res.json.should.have.been.calledWith(
        sinon.match.number,
        sinon.match({ error: 'error_code' })
      )

    it 'should provide an error description', ->
      res.json.should.have.been.calledWith(
        sinon.match.number,
        sinon.match({ error_description: 'description' })
      )


        error err, req, res, next

    it 'should respond 400', ->
      res.status.should.have.been.calledWith 400

    it 'should respond with JSON', ->
      json.should.have.been.called

    it 'should set the Cache-Control header', ->
      res.headers['Cache-Control'].should.equal 'no-store'
