         done()
 
     it 'should delete a model from db', (done) ->
-      user = new User getFakeUserData()
+      user2 = new User getFakeUserData()
+      user2.save (err) ->
+        should.not.exist err
+        user2.remove (err) ->
+          should.not.exist err
+          done()
+
+    it 'should create a record for hasMany relation', (done) ->
+      post = user.addPost getFakePost()
+      should.not.exist post.id
       user.save (err) ->
-        should.not.exist err
-        user.remove (err) ->
-          should.not.exist err
-          done()+        should.exist post.id
+        post.userId.should.equal user.id
+        done()
  # after (done) ->
  #   r.dbDrop(app.config.rethinkdb.db).run app.db.getConn(), done
  describe 'Model Instanse', ->
    it 'should save new model to db', (done) ->
      user = new User getFakeUserData()
      user.save (err) ->

  username: Faker.Internet.userName()
  email: Faker.Internet.email()

getFakePost = ->
  title: Faker.Lorem.sentence()
  body: Faker.Lorem.paragraphs 3

describe 'Model', ->
  app = null
