<commit_before>'use strict';

/**
 * Module dependencies.
 */
var should = require('should'),
	mongoose = require('mongoose'),
	report = require('../../../app/controllers/report');
	var fs = require('fs');
	

/**
 * Globals
 */
 var fileCreated = false;

describe('Report Controller Tests:', function() {
	beforeEach(function(done) {

		done();
	});

	describe('Method Generate', function() {
		
		it('should successfully execute given normal parameters', function(done) {
			var req = {report: {_id: 'debug'}};
			this.timeout(10000);
	
			report.generate(req, {}, function(){
				fileCreated = true;
				
				//Will have error if pdf was not created successfully
				fs.readFile('./public/modules/reports/pdf/' + req.report._id + '.pdf', function(err, data){
					should.not.exist(err);
					done();
				});
			});
		});
		
		it('should catch and show a 500 error code on null req', function(done) {
			this.timeout(10000);
		
			report.generate({},{
				status: function(data) { 
				expect(data).to.equal(500);
				done();
			}}, function(){});
		});	
			
		it('should catch and show a 500 error code on blank req.report._id', function(done) {
			var req = {report: {_id: ""}};
			this.timeout(10000);
		
			report.generate(req,{
				status: function(data) { 
				expect(data).to.equal(500);
				done();
			}}, function(){});
		});
	});
	
	describe('Method Submit', function() {
		it('should successfully execute given normal parameters (TEST NOT IMPLEMENTED)', function(done) {
			done();
		});
	});

	afterEach(function(done) {<commit_msg>Fixed stupid syntax error I committed 30 seconds ago<commit_after>'use strict';

/**
 * Module dependencies.
 */
var should = require('should'),
	mongoose = require('mongoose'),
	report = require('../../../app/controllers/report');
	var fs = require('fs');
	

/**
 * Globals
 */
 var fileCreated = false;

describe('Report Controller Tests:', function() {
	beforeEach(function(done) {

		done();
	});

	describe('Method Generate', function() {
		
		it('should successfully execute given normal parameters', function(done) {
			var req = {report: {_id: 'debug'}};
			this.timeout(10000);
	
			report.generate(req, {}, function(){
				fileCreated = true;
				
				//Will have error if pdf was not created successfully
				fs.readFile('./public/modules/reports/pdf/' + req.report._id + '.pdf', function(err, data){
					should.not.exist(err);
					done();
				});
			});
		});
		
		it('should catch and show a 500 error code on null req', function(done) {
			this.timeout(10000);
		
			report.generate({},{
				status: function(data) { 
				expect(data).to.equal(500);
				done();
			}}, function(){});
		});	
			
		it('should catch and show a 500 error code on blank req.report._id', function(done) {
			var req = {report: {_id: ''}};
			this.timeout(10000);
		
			report.generate(req,{
				status: function(data) { 
				expect(data).to.equal(500);
				done();
			}}, function(){});
		});
	});
	
	describe('Method Submit', function() {
		it('should successfully execute given normal parameters (TEST NOT IMPLEMENTED)', function(done) {
			done();
		});
	});

	afterEach(function(done) {
{'fraction_non_alphanumeric': 0.18024928092042186, 'fraction_numerical': 0.017897091722595078, 'mean_word_length': 3.3776223776223775, 'pattern_counts': {'":': 0, '<': 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': '4039314', 'n_tokens_mistral': 1193, 'n_tokens_neox': 950, 'n_words': 242}