       expect(@categories.externalId2id['123']).toBe 'idx'
       expect(@categories.externalId2id['234']).toBe 'idy'
       expect(@categories.externalId2id['345']).toBe 'idz'
-      expect(_.size @categories.duplicateNames).toBe 0+      expect(_.size @categories.duplicateNames).toBe 0


    it 'should create maps for children categories', ->
      categories = [
        { id: 'idx', name: { en: 'root' } }
        { id: 'idy', name: { en: 'main' }, ancestors: [ { id: 'idx' } ] }
        { id: 'idz', name: { en: 'sub' }, ancestors: [ { id: 'idx' }, { id: 'idy' } ] }
      ]
      @categories.buildMaps categories
      expect(_.size @categories.id2index).toBe 3

  describe '#buildMaps', ->
    it 'should create maps for root categories', ->
      categories = [
        { id: 1, name: { en: 'cat1' }, slug: { en: 'cat-1'} }
        { id: 2, name: { en: 'cat2' }, slug: { en: 'cat-2'} }
      ]
      @categories.buildMaps categories
      expect(_.size @categories.id2index).toBe 2
