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

      expect(@categories.externalId2id['123']).toBe 'idx'
      expect(@categories.externalId2id['234']).toBe 'idy'
      expect(@categories.externalId2id['345']).toBe 'idz'
      expect(_.size @categories.duplicateNames).toBe 0
  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
