title: Mocha test cases throwing Error: expected 200 "OK", got 403 "Forbidden"
body: <p>I am using mochajs for my mean applications server side test cases.The test cases are showing an error, <code>Error: expected 200 "OK", got 403 "Forbidden"</code>.
  I tried using console logs inside the functions that I am trying to test, but they never get executed. I am unable to find out the issue. Can someone help me with this. </p>
  
  <p><strong>My controller</strong></p>
  
  <pre><code>exports.signin = function(req, res) {
     req.body.username = new Buffer(req.body.username, base64').toString('ascii');
      User.findOne({
          username: req.body.username.toLowerCase()
      }, function(err, user) {
          if (err) {
              //do something
          } else if (!user) {
              //do something
          } else {
              //do something
          }
      });
  };
  </code></pre>
  
  <p><strong>My test case</strong></p>
  
  <pre><code>it('should be able to signin if the credentials are valid', function(done) {
      var obj = {
          username: new Buffer('demo').toString('base64'),
          password: new Buffer('demouser').toString('base64')
          };
      agent.post('/auth/signin')
          .send(obj)
          .expect(200)
          .end(function(signinErr, res) {
                  if (signinErr){
                        console.log(signinErr);
                      done(signinErr);
                  }
                  else{
                      var temp = res.body;
                      console.log(temp);
              done();
                  }
      });
  });
  </code></pre>
  
  <p><strong>And my route</strong></p>
  
  <pre><code>app.route('/auth/signin').post(users.signin);
  </code></pre>