title: Mocha- test api with multiple http status
body: <p>I am testing an API <strong>[Singn up a user]</strong>  with multiple possibilities of http response codes. Like</p>
  
  <pre><code>1. http status code -200. 
  </code></pre>
  
  <blockquote>
    <p>Message:"User Added successfull"</p>
  </blockquote>
  
  <pre><code>2. http status code -422
  </code></pre>
  
  <blockquote>
    <p>Meaasage:"Input Data Missing"</p>
  </blockquote>
  
  <pre><code>3. http status code -500
  </code></pre>
  
  <blockquote>
    <p>Meaasage:"User Added successfull"</p>
  </blockquote>
  
  <pre><code>4. http status code -409
  </code></pre>
  
  <blockquote>
    <p>Meaasage:"User Already Exixts"</p>
  </blockquote>
  
  <p>how could i Test such APi with mocha . Here is My Code</p>
  
  <pre><code>describe('mobile/user api ',function(){
  
  it('signup user with username ,email and password only',function(done){
    chai.request(testCaseUrl)
        .post('/v2/mobile/organizers/'+organizerId+'/apps/'+appid+'/attendees/signup')
        .send({'name':'afraz','email':'afrazahmad@gmail.com','password':'newton'})
        .end(function(err,res){
  
          console.log(res.text.message);
           if(err){
               done(err);
               return;
           }
           //Expecting multiple  response status here
           res.status.should.be.equal(400);
           done(res.text);
  
          });
  
  });
  </code></pre>