| Total Complexity | 3 |
| Complexity/F | 1 |
| Lines of Code | 16 |
| Function Count | 3 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | 'use strict' |
||
| 2 | var mongoose = require('mongoose') |
||
| 3 | var Price = mongoose.model('Price') |
||
| 4 | var chai = require('chai') |
||
| 5 | var expect = chai.expect |
||
| 6 | |||
| 7 | describe('Unit Test Price Model', function () { |
||
| 8 | it('should be invalid if name is empty', function (done) { |
||
| 9 | var price = new Price() |
||
| 10 | |||
| 11 | price.validate(function (err) { |
||
| 12 | expect(err.errors.name).to.exist |
||
|
|
|||
| 13 | done() |
||
| 14 | }) |
||
| 15 | }) |
||
| 16 | }) |
||
| 17 |