<commit_before>/**
 * RootController.test.js
 */
var request = require('supertest');
var should = require('should');

/**
 * Test /user/password endpoint.
 */
describe('Requests to the root (/user/password) path', function() {
  
  it('POST: Valid password request with only user_id returns expected results.', function(done) {

    request(sails.hooks.http.app)
      .post('/api/v1/user/password')
      .send({
        "user_id": "1234567"
      })
      .expect(200)
      .expect("content-type", /json/)
      .end(function(err, response) {
        if (err) {
          throw err;
        }
        response.status.should.equal(200)
        response.body.should.equal("OK")
        done();
      });
  });
  
  it('POST: Valid password request with only email returns expected results.', function(done) {
<commit_msg>Test coverage for error response from /user/password<commit_after>/**
 * RootController.test.js
 */
var request = require('supertest');
var should = require('should');

/**
 * Test invalid /user/password endpoint.
 */
describe('Requests to the root (/user/password) path with missing required body parameters.', function() {
  
  it('POST: Invalid password reset request with missing body parameters returns expected 422 - Unprocessable due to request validation error results.', function(done) {

    request(sails.hooks.http.app)
      .post('/api/v1/user/password')
      .send({
      })
      .expect(422)
      .expect("content-type", /json/)
      .end(function(err, response) {
        if (err) {
          throw err;
        }
        response.status.should.equal(422)
        response.body.should.equal("OK")
        done();
      });
  });
  
});

/**
 * Test /user/password endpoint.
 */
describe('Requests to the root (/user/password) path', function() {
  
  it('POST: Valid password request with only user_id returns expected results.', function(done) {

    request(sails.hooks.http.app)
      .post('/api/v1/user/password')
      .send({
        "user_id": "1234567"
      })
      .expect(200)
      .expect("content-type", /json/)
      .end(function(err, response) {
        if (err) {
          throw err;
        }
        response.status.should.equal(200)
        response.body.should.equal("OK")
        done();
      });
  });
  
  it('POST: Valid password request with only email returns expected results.', function(done) {

{'fraction_non_alphanumeric': 0.1504424778761062, 'fraction_numerical': 0.016013485040033713, 'mean_word_length': 2.5327380952380953, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, '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': '5831327', 'n_tokens_mistral': 719, 'n_tokens_neox': 690, 'n_words': 171}