不要怂,就是干,撸起袖子干!

Commit ac691957 by Mick Hansen

update validation test to be async

1 parent 889a0860
Showing with 6 additions and 4 deletions
...@@ -651,7 +651,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() { ...@@ -651,7 +651,7 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() {
}) })
}) })
it('skips validations for the given fields', function() { it('skips validations for the given fields', function(done) {
var values = ['value1', 'value2'] var values = ['value1', 'value2']
var Bar = this.sequelize.define('Bar' + config.rand(), { var Bar = this.sequelize.define('Bar' + config.rand(), {
...@@ -665,9 +665,11 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() { ...@@ -665,9 +665,11 @@ describe(Support.getTestDialectTeaser("DaoValidator"), function() {
}) })
var failingBar = Bar.build({ field: 'value3' }) var failingBar = Bar.build({ field: 'value3' })
, errors = failingBar.validate({ skip: ['field'] })
failingBar.validate({ skip: ['field'] }).success(function(errors) {
expect(errors).to.be.null expect(errors).not.to.exist
done()
})
}) })
}) })
}) })
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!