Tests for ensureIndex