<commit_before>var assert    = require('assert')
  , should    = require('should')
  , db        = require('../../../models');

describe('Jobs modules api', function(){
    it('find all jobs', function(done){
        db.job.findAll().success(function(jobs){
            console.log(JSON.stringify(jobs));
            jobs.should.be.ok;
            done();
        });
    })
    it('create job', function(done){
        db.job.create({
              TITLE : 'Job Title Test'
            , DESCRIPTION : 'Lorem ipsum dolor sit amet,'+
                            'consectetur adipiscing elit'
            , EMAIL     : '<EMAIL>'
            , LOCATION  : 'SP - São Paulo'
            , APPLY_URL : null
            , COMPANY_NAME : 'BitVagas.<EMAIL>'
            , COMPANY_URL  : null
            , BTC_ADDRESS  : null
            , ACTIVE       : true
        }).success(function(job){
            console.log(JSON.stringify(job));
            job.should.be.ok;
            done();
        });
    })
});
<commit_msg>added unit test to jobs<commit_after>var assert    = require('assert')
  , should    = require('should')
  , db        = require('../../../models');

describe('Jobs modules api', function(){
    it('create categories', function(done){
        db.category.create({
            id   : 1
          , NAME : 'Development'
        }).then(function(category){
            console.log(JSON.stringify(category));
            category.should.be.ok;
            done();
        })
    })
    it('create job types', function(done){
        db.job_type.bulkCreate([
          { NAME : 'FULL-TIME' }
        , { NAME : 'PART-TIME' }
        , { NAME : 'FREELANCE' }
        , { NAME : 'TEMPORARY' }
        ]).then(function(){
            db.job_type.findAll().then(function(types){
                console.log(JSON.stringify(types));
                types.should.be.ok;
                done();
            });
        });
    })
    it('create job', function(done){
        db.job.create({
              TITLE : 'Job Title Test'
            , DESCRIPTION  : 'Lorem ipsum dolor sit amet,'+
                            'consectetur adipiscing elit'
            , EMAIL        : '<EMAIL>'
            , LOCATION     : 'SP - São Paulo'
            , APPLY_BY     : null
            , COMPANY_NAME : '<EMAIL>'
            , COMPANY_URL  : null
            , BTC_ADDRESS  : null
            , ACTIVE       : true
        }).then(function(job){
            job.setCategory({ id : 1 }).then(function(job){
                console.log(JSON.stringify(job));
                job.should.be.ok;
                done();
            });
        });
    })
    it('find all jobs', function(done){
        db.job.findAll({include : [db.category]}).then(function(jobs){
            console.log(JSON.stringify(jobs));
            jobs.should.be.ok;
            done();
        });
    })
});

{'fraction_non_alphanumeric': 0.15010423905489922, 'fraction_numerical': 0.0006949270326615705, 'mean_word_length': 1.4357021996615906, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5088805', 'n_tokens_mistral': 850, 'n_tokens_neox': 814, 'n_words': 151}