               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 err, null

          # add back in middleware
          PreviouslyUnencryptedSchema.plugin encrypt,
            encryptionKey: encryptionKey
            signingKey: signingKey,
            _suppressDuplicatePluginError: true # to allow for this test

          PreviouslyUnencryptedModel.findById(@docId).lean().exec (err, migratedDoc) =>
            assert.equal err, null
            assert.notProperty migratedDoc, 'text', 'Should be encrypted in db after migration'
            assert.notProperty migratedDoc, 'bool'

            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
