   ).then( (user) ->
     callback = (err, user) ->
       assert.notOk user, "Expected user to not be returned when authentication fails"
-
       done()
 
     user.loginFromLocalDb("ships", callback)
-  ).fail( (err) ->
-    console.error err
-    throw err
-  )
+  ).fail(done)
 )
 
 test("Usernames must be unique", (done) ->
   helpers.createUser().then( (user) ->
     helpers.createUser()
-  ).then( (user) ->
-
-    assert.isUndefined user, "Expected duplicate user creation to fail"
-    done()
-
+  ).then( ->
+    done(new Error("Expected duplicate user creation to fail"))
   ).fail( (err) ->
-
     console.error err
     assert.match err, /duplicate key error index/
     done()
-
   )
 )

    authenticationCallback = (err, user) ->
      assert.ok user, "Expected user to be returned when authentication successful"
      assert.strictEqual "hats", user.email

      done()

    user.loginFromLocalDb("boats", authenticationCallback)
  ).fail( (err) ->
    console.error err
    throw err
  )
)

test(".loginFromLocalDb fails if the user's password is incorrect", (done) ->

  user = new User(password: "password")

  user.save( (err, savedUser) ->
    return done(err) if err?

    assert.notStrictEqual(
      "password",
