<commit_before>/*global describe:false, it:false, beforeEach:false, afterEach:false, request:false, mock:false*/

'use strict';

var mongoose = require('mongoose');
var mockgoose = require('mockgoose');

describe('/isValidTimestamp', function() {
    it('should return true for a valid timestamp more than one day after January 1, 2014', function(done) {
        request(mock)
            .get('/isValidTimestamp/2014/0000000001/201401100000')
            .expect(200)
            .expect('Content-Type', /json/)
            .expect(/"result":true/)

            .end(function (err, res) {
                done(err);
            });
    });

    it('should return false for an timestamp less than one day after January 1, 2014', function(done) {
        request(mock)
            .get('/isValidTimestamp/2014/0000000001/201401011800')
            .expect(200)
            .expect('Content-Type', /json/)
            .expect(/"result":false/)

            .end(function (err, res) {
                done(err);
            });
    });

    it('should return false for an timestamp before January 1, 2014', function(done) {
        request(mock)
            .get('/isValidTimestamp/2014/0000000001/201311011800')
            .expect(200)
            .expect('Content-Type', /json/)
            .expect(/"result":false/)

            .end(function (err, res) {
                done(err);
            });
    });

});<commit_msg>fixed to reflect controller type errors<commit_after>/*global describe:false, it:false, beforeEach:false, afterEach:false, request:false, mock:false*/

'use strict';

var mongoose = require('mongoose');
var mockgoose = require('mockgoose');

describe('/isValidTimestamp', function() {
    it('should return true for a valid timestamp more than one day after January 1, 2014', function(done) {
        request(mock)
            .get('/isValidTimestamp/2014/0000000001/201401100000')
            .expect(200)
            .expect('Content-Type', /json/)
            .expect(/"result":true/)

            .end(function (err, res) {
                done(err);
            });
    });

    it('should return a 500 if there is a problem', function(done) {
        mockgoose.setMockReadyState(mongoose.connection, 0);

        request(mock)
            .get('/isValidTimestamp/2014/0000000001/201401100000')
            .expect(500)
            .expect('Content-Type', /json/)
            .expect(/"code":/)
            .end(function (err, res) {
                mockgoose.setMockReadyState(mongoose.connection, 1);
                done(err);
            });
    });

});
{'fraction_non_alphanumeric': 0.14263625821414766, 'fraction_numerical': 0.06571318129107073, 'mean_word_length': 2.1256038647342996, 'pattern_counts': {'":': 5, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 5, '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': '2254698', 'n_tokens_mistral': 845, 'n_tokens_neox': 706, 'n_words': 161}