               migratedDoc.save (err) =>
                 assert.equal err, null
 
-                PreviouslyUnencryptedModel.findById(@docId).lean().exec (err, migratedDoc) =>
+                PreviouslyUnencryptedModelMigrated.findById(@docId).lean().exec (err, migratedDoc) =>
                   assert.equal err, null
                   assert.notProperty migratedDoc, 'text', 'Should be encrypted in raw db after saved'
                   assert.notProperty migratedDoc, 'bool'

        assert.equal @parentDoc.children[0].text, 'Child unencrypted text'

      it 'should persist children as encrypted', (done) ->
        @ParentModel.find
          _id: @parentDoc._id
          'children._ct': $exists: true
          'children.text': $exists: false
        , (err, docs) ->
          assert.equal err, null
          assert.lengthOf docs, 1
          assert.propertyVal docs[0].children[0], 'text', 'Child unencrypted text'

            assert.property migratedDoc, '_ct', 'Should have ciphertext in raw db after migration'


            PreviouslyUnencryptedModelMigrated.findById @docId, (err, migratedDoc) =>
              console.log(migratedDoc)
              assert.equal err, null, 'There should be no authentication error after migrated'
              assert.propertyVal migratedDoc, 'text', 'Plain'
              assert.propertyVal migratedDoc, 'bool', true
