<commit_before>var request = require('supertest'),
    assert  = require('chai').assert;

describe('UserController', function() {
  /**
  * Auth with bad email and bad password
  *
  */
  describe('.auth(false): POST /user/authenticate', function() {
    it('Should return auth:false status when using bad email and password', function(done) {

      var email = "<EMAIL>"; //test bad email case
      var password = "<PASSWORD>"; //test bad password case

      request(sails.hooks.http.app)
        .post('/user/authenticate')
        .send({email:email,password:password})
        .set('Content-Type','application/json')
        .expect('Content-Type', /json/)
        .expect(function(res){
          //auth status
          assert.property(res.body,'auth','Auth status returned');
          assert.strictEqual(res.body.auth,false,'Auth status equal false')
        })
        .expect(200,done);  

    })
  });
  /**
  * Auth with good email and bad password
  *
  */
  describe('.auth(false): POST /user/authenticate', function() {
    it('Should return auth:false status when the email is good and password bad', function(done) {

      var email = "<EMAIL>"; //test bad email case
      var password = "<PASSWORD>"; //test bad password case

      request(sails.hooks.http.app)
        .post('/user/authenticate')
        .send({email:email,password:password})
        .set('Content-Type','application/json')
        .expect('Content-Type', /json/)
        .expect(function(res){
          //auth status
          assert.property(res.body,'auth','Auth status returned');
          assert.strictEqual(res.body.auth,false,'Auth status equal false')
        })
        .expect(200,done);  

    })
  });

  /**
  * Auth with good match
  *
  */
  describe('.auth(true): POST /user/authenticate', function() {
    it('Should return the email, email and auth:true status when the match is good', function(done) {

      var email = "<EMAIL>"; //test good email case
      var password = "<PASSWORD>"; //good password case

      request(sails.hooks.http.app)
        .post('/user/authenticate')
        .send({email:email,password:password})
        .set('Content-Type', 'application/json')
        .expect('Content-Type', /json/)
        .expect(function (res) {
          //auth status
          assert.property(res.body,'auth', 'Auth status returned');
          assert.strictEqual(res.body.auth, true, 'Auth statue equals true');
          //email
          assert.property(res.body,'email', 'Email returned');
          assert.strictEqual(res.body.email, email, 'Email equals : ' + email);
        })
        .expect(200, done);
    })
  });
});<commit_msg>Fixing little errors in comments and other details that might cause errors if working on the code later on<commit_after>var request = require('supertest'),
    assert  = require('chai').assert;

describe('UserController', function() {
  /**
  * Auth with bad email and bad password
  *
  */
  describe('.auth(false): POST /user/authenticate', function() {
    it('Should return auth:false status when using bad email and password', function(done) {

      var email = "<EMAIL>"; //test bad email case
      var password = "<PASSWORD>"; //test bad password case

      request(sails.hooks.http.app)
        .post('/user/authenticate')
        .send({email : email, password : password})
        .set('Content-Type', 'application/json')
        .expect('Content-Type', /json/)
        .expect(function(res) {
          //auth status
          assert.property(res.body, 'auth', 'Auth status returned');
          assert.strictEqual(res.body.auth, false, 'Auth status equal false')
        })
        .expect(200, done);  

    })
  });
  /**
  * Auth with good email and bad password
  *
  */
  describe('.auth(false): POST /user/authenticate', function() {
    it('Should return auth:false status when the email is good and password bad', function(done) {

      var email = "<EMAIL>"; //test good email case
      var password = "<PASSWORD>"; //test bad password case

      request(sails.hooks.http.app)
        .post('/user/authenticate')
        .send({email : email, password : password})
        .set('Content-Type', 'application/json')
        .expect('Content-Type', /json/)
        .expect(function(res) {
          //auth status
          assert.property(res.body, 'auth', 'Auth status returned');
          assert.strictEqual(res.body.auth, false, 'Auth status equal false')
        })
        .expect(200, done);  

    })
  });

  /**
  * Auth with good match
  *
  */
  describe('.auth(true): POST /user/authenticate', function() {
    it('Should return the email, email and auth:true status when the match is good', function(done) {

      var email = "<EMAIL>"; //test good email case
      var password = "<PASSWORD>"; //good password case

      request(sails.hooks.http.app)
        .post('/user/authenticate')
        .send({email : email, password : password})
        .set('Content-Type', 'application/json')
        .expect('Content-Type', /json/)
        .expect(function (res) {
          //auth status
          assert.property(res.body, 'auth', 'Auth status returned');
          assert.strictEqual(res.body.auth, true, 'Auth statue equals true');
          //email
          assert.property(res.body,'email', 'Email returned');
          assert.strictEqual(res.body.email, email, 'Email equals : ' + email);
        })
        .expect(200, done);
    })
  });
});
{'fraction_non_alphanumeric': 0.15364869820315366, 'fraction_numerical': 0.0033003300330033004, 'mean_word_length': 2.535320803629294, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3216236', 'n_tokens_mistral': 1559, 'n_tokens_neox': 1514, 'n_words': 404}