<commit_before>'use strict';

/**
 * Module dependencies.
 */
var should = require('should'),
  mongoose = require('mongoose'),
  Media = mongoose.model('Media');

/**
 * Globals
 */
var media;

/**
 * Unit tests
 */
describe('Media Model Unit Tests:', function () {
  beforeEach(function (done) {

    media = new Media({
      // Add model fields
      // ...
      type: 'audio'
    });

    media.save(function () {
      done();
    });
  });

  describe('Method Save', function () {
    it('should be able to save without problems', function (done) {
      return media.save(function (err) {
        should.not.exist(err);
        done();
      });
    });
  });

  describe('Schema', function () {

    describe('validations', function () {

      var validMediaDoc, invalidMedia;

      beforeEach(function(done) {
        validMediaDoc = {
          type: 'audio'
        };
        done();
      });

      it('should require a type property', function (done) {
        delete validMediaDoc.type;
        invalidMedia = new Media(validMediaDoc);
        return invalidMedia.save(function (err) {
          should.exist(err);
          done();
        });
      });

      it('should require a non-empty type property', function (done) {
        validMediaDoc.type = '';
        invalidMedia = new Media(validMediaDoc);
        return invalidMedia.save(function (err) {
          should.exist(err);
          done();
        });
      });
    });
  });

  afterEach(function (done) {
    Media.remove().exec();

    done();
  });
});<commit_msg>Require Media artist<commit_after>'use strict';

/**
 * Module dependencies.
 */
var should = require('should'),
  mongoose = require('mongoose'),
  Media = mongoose.model('Media');

/**
 * Globals
 */
var media;

/**
 * Unit tests
 */
describe('Media Model Unit Tests:', function () {
  beforeEach(function (done) {

    media = new Media({
      // Add model fields
      // ...
      type: 'audio'
    });

    media.save(function () {
      done();
    });
  });

  describe('Method Save', function () {
    it('should be able to save without problems', function (done) {
      return media.save(function (err) {
        should.not.exist(err);
        done();
      });
    });
  });

  describe('Schema', function () {

    describe('validations', function () {

      var validMediaDoc, invalidMedia;

      beforeEach(function(done) {
        validMediaDoc = {
          type: 'audio',
          artist: '<NAME>'
        };
        done();
      });

      it('should require a type property', function (done) {
        delete validMediaDoc.type;
        invalidMedia = new Media(validMediaDoc);
        return invalidMedia.save(function (err) {
          should.exist(err);
          done();
        });
      });

      it('should require a non-empty type property', function (done) {
        validMediaDoc.type = '';
        invalidMedia = new Media(validMediaDoc);
        return invalidMedia.save(function (err) {
          should.exist(err);
          done();
        });
      });

      it('should require an artist property', function (done) {
        delete validMediaDoc.artist;
        invalidMedia = new Media(validMediaDoc);
        return invalidMedia.save(function (err) {
          should.exist(err);
          done();
        });
      });
    });
  });

  afterEach(function (done) {
    Media.remove().exec();

    done();
  });
});
{'fraction_non_alphanumeric': 0.15616759449164958, 'fraction_numerical': 0.0, 'mean_word_length': 2.112123974475843, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '6529761', 'n_tokens_mistral': 975, 'n_tokens_neox': 956, 'n_words': 221}