Fix coding style
This commit is contained in:
parent
418cc03a27
commit
2dae68b5e0
|
@ -17,25 +17,25 @@ User = schema.define 'User',
|
||||||
pendingPeriod: Number
|
pendingPeriod: Number
|
||||||
createdByAdmin: Boolean
|
createdByAdmin: Boolean
|
||||||
|
|
||||||
it "should trigger after initialize", (test)->
|
it "should trigger after initialize", (test) ->
|
||||||
User.afterInitialize = ()->
|
User.afterInitialize = ->
|
||||||
User.afterInitialize = null
|
User.afterInitialize = null
|
||||||
test.done()
|
test.done()
|
||||||
user = new User
|
user = new User
|
||||||
|
|
||||||
|
|
||||||
it "should trigger before create", (test)->
|
it "should trigger before create", (test) ->
|
||||||
User.beforeCreate = ()->
|
User.beforeCreate = () ->
|
||||||
User.beforeCreate = null
|
User.beforeCreate = null
|
||||||
test.done()
|
test.done()
|
||||||
User.create {}, ()-> test.ok "saved"
|
User.create -> test.ok "saved"
|
||||||
|
|
||||||
it "should trigger after create", (test) ->
|
it "should trigger after create", (test) ->
|
||||||
User.afterCreate = (next) ->
|
User.afterCreate = (next) ->
|
||||||
User.afterCreate = null
|
User.afterCreate = null
|
||||||
next()
|
next()
|
||||||
|
|
||||||
User.create {}, ->
|
User.create ->
|
||||||
test.ok "saved"
|
test.ok "saved"
|
||||||
test.done()
|
test.done()
|
||||||
|
|
||||||
|
@ -53,8 +53,8 @@ it 'should trigger before save', (test) ->
|
||||||
test.ok 'saved'
|
test.ok 'saved'
|
||||||
test.done()
|
test.done()
|
||||||
|
|
||||||
it 'should trigger after save', (test)->
|
it 'should trigger after save', (test) ->
|
||||||
User.afterSave = (next)->
|
User.afterSave = (next) ->
|
||||||
User.afterSave = null
|
User.afterSave = null
|
||||||
next()
|
next()
|
||||||
|
|
||||||
|
@ -64,30 +64,30 @@ it 'should trigger after save', (test)->
|
||||||
test.done()
|
test.done()
|
||||||
|
|
||||||
it "should trigger before update", (test) ->
|
it "should trigger before update", (test) ->
|
||||||
User.beforeUpdate = ()->
|
User.beforeUpdate = () ->
|
||||||
User.beforeUpdate = null
|
User.beforeUpdate = null
|
||||||
test.done()
|
test.done()
|
||||||
User.create {}, (err, user)->
|
User.create {}, (err, user) ->
|
||||||
user.updateAttributes {email:"1@1.com"}, () -> test.ok "updated"
|
user.updateAttributes email:"1@1.com", -> test.ok "updated"
|
||||||
|
|
||||||
it "should trigger after update", (test) ->
|
it "should trigger after update", (test) ->
|
||||||
User.afterUpdate = ()->
|
User.afterUpdate = () ->
|
||||||
User.afterUpdate = null
|
User.afterUpdate = null
|
||||||
test.done()
|
test.done()
|
||||||
User.create {}, (err, user)->
|
User.create (err, user) ->
|
||||||
user.updateAttributes {email:"1@1.com"}, ()-> test.ok "updated"
|
user.updateAttributes email: "1@1.com", -> test.ok "updated"
|
||||||
|
|
||||||
it "should trigger before destroy", (test)->
|
it "should trigger before destroy", (test)->
|
||||||
User.beforeDestroy = ()->
|
User.beforeDestroy = () ->
|
||||||
User.beforeDestroy = null
|
User.beforeDestroy = null
|
||||||
test.done()
|
test.done()
|
||||||
User.create {}, (err, user)->
|
User.create {}, (err, user) ->
|
||||||
user.destroy()
|
user.destroy()
|
||||||
|
|
||||||
it "should trigger after destroy", (test)->
|
it "should trigger after destroy", (test) ->
|
||||||
User.afterDestroy = ()->
|
User.afterDestroy = () ->
|
||||||
User.afterDestroy = null
|
User.afterDestroy = null
|
||||||
test.done()
|
test.done()
|
||||||
User.create {}, (err, user)->
|
User.create (err, user) ->
|
||||||
user.destroy()
|
user.destroy()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue