<commit_before>Client = require('request-json').JsonClient
should = require 'should'
fixtures = require 'cozy-fixtures'
path = require 'path'

helpers = require './helpers'
helpers.options =
    serverHost: 'localhost'
    serverPort: '8888'
client = new Client "http://localhost:8888/"

fixtures.setDefaultValues
    dirPath: path.resolve __dirname, './fixtures/'
    silent: true
    removeBeforeLoad: false # useless because we clean the DB before tests

describe "Doctype list management", ->

    before helpers.startApp
    before helpers.cleanDB

    after helpers.stopApp
    after helpers.cleanDB

    describe "When the database is empty", ->

        it "There shouldn't be items in doctypes list", (done) ->
            client.get 'doctypes', (err, res, body) ->
                should.exist res
                res.should.have.property 'statusCode'
                res.statusCode.should.equal 200<commit_msg>Removed duplicate information<commit_after>Client = require('request-json').JsonClient
should = require 'should'
fixtures = require 'cozy-fixtures'
path = require 'path'

helpers = require './helpers'
helpers.options =
    serverHost: 'localhost'
    serverPort: '8888'
client = new Client "http://#{helpers.options.serverHost}:#{helpers.options.serverPort}/"

fixtures.setDefaultValues
    dirPath: path.resolve __dirname, './fixtures/'
    silent: true
    removeBeforeLoad: false # useless because we clean the DB before tests

describe "Doctype list management", ->

    before helpers.startApp
    before helpers.cleanDB

    after helpers.stopApp
    after helpers.cleanDB

    describe "When the database is empty", ->

        it "There shouldn't be items in doctypes list", (done) ->
            client.get 'doctypes', (err, res, body) ->
                should.exist res
                res.should.have.property 'statusCode'
                res.statusCode.should.equal 200
{'fraction_non_alphanumeric': 0.10404624277456648, 'fraction_numerical': 0.009458749343142408, 'mean_word_length': 3.008421052631579, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '2066850', 'n_tokens_mistral': 550, 'n_tokens_neox': 531, 'n_words': 157}