Fix coding style

This commit is contained in:
Anatoliy Chakkaev 2012-06-02 22:41:28 +04:00
parent 418cc03a27
commit 2dae68b5e0
1 changed files with 32 additions and 32 deletions

View File

@ -18,7 +18,7 @@ User = schema.define 'User',
createdByAdmin: Boolean
it "should trigger after initialize", (test) ->
User.afterInitialize = ()->
User.afterInitialize = ->
User.afterInitialize = null
test.done()
user = new User
@ -28,14 +28,14 @@ it "should trigger before create", (test)->
User.beforeCreate = () ->
User.beforeCreate = null
test.done()
User.create {}, ()-> test.ok "saved"
User.create -> test.ok "saved"
it "should trigger after create", (test) ->
User.afterCreate = (next) ->
User.afterCreate = null
next()
User.create {}, ->
User.create ->
test.ok "saved"
test.done()
@ -68,14 +68,14 @@ it "should trigger before update", (test) ->
User.beforeUpdate = null
test.done()
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) ->
User.afterUpdate = () ->
User.afterUpdate = null
test.done()
User.create {}, (err, user)->
user.updateAttributes {email:"1@1.com"}, ()-> test.ok "updated"
User.create (err, user) ->
user.updateAttributes email: "1@1.com", -> test.ok "updated"
it "should trigger before destroy", (test)->
User.beforeDestroy = () ->
@ -88,6 +88,6 @@ it "should trigger after destroy", (test)->
User.afterDestroy = () ->
User.afterDestroy = null
test.done()
User.create {}, (err, user)->
User.create (err, user) ->
user.destroy()