<commit_before>'use strict'

let should = require('chai').should();
let ch =  require('charlatan');
let request =  require('superagent');
let url = require('url');
const ABS_URL = "http://localhost:3000/api/photos";

describe('photos routes testing', () => {
	let id = null
		, photo = {	
				legend : ch.Lorem.words({wordCount : 5, supplemental : false})
		}
		;

	it('it should be an user create one photo' , done => {
		request
			.post(url.resolve(ABS_URL, 'photos'))
			.send(photo)
			.end((err, res) => {
				res.should.be.exist;
				res.body._id.should.exist;
				id = res.body_id;
				res.status.should.be.eql(201);
				done();
			});
	});
});
<commit_msg>new test for images upload in create added<commit_after>'use strict'

let should = require('chai').should();
let ch =  require('charlatan');
let request =  require('superagent');
let url = require('url');
const ABS_URL = "http://localhost:3000/api/photos";

describe('photos routes testing', () => {
	let id = null;
	let photo = {
		legend : ch.Lorem.word()
	};
	
	it('it should be an user create one photo' , done => {
		request
			.post(url.resolve(ABS_URL, './photos'))
			.send(photo)
			.attach('image', '../server/tests/test.png')
			.field('legend', photo.legend)
			.end((err, res) => {
				res.should.be.exist;
				res.body._id.should.exist;
				res.body.legend.should.be.eql(photo.legend);
				res.body.path.should.exist;
				id = res.body_id;
				res.status.should.be.eql(201);
				done();
			});

	});
	
});

{'fraction_non_alphanumeric': 0.1898989898989899, 'fraction_numerical': 0.010101010101010102, 'mean_word_length': 3.3197674418604652, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '1221601', 'n_tokens_mistral': 621, 'n_tokens_neox': 522, 'n_words': 111}