     Enterprises.enterprises[0].active = false
     expect(Enterprises.hubs[0].active).toBe false
 
-  it "delegates producers array to Enterprises", ->
-    expect(Enterprises.producers[0]).toBe enterprises[1]
+  it "filters Enterprises.producers into a new array", ->
+    expect(Enterprises.producers[0]).toBe Enterprises.enterprises[4]
+    Enterprises.enterprises[4].active = false
+    expect(Enterprises.producers[0].active).toBe false
+
+  it "only includes visible enterprises in hubs array", ->
+    expect(Enterprises.hubs).toContain Enterprises.enterprises[0]
+    expect(Enterprises.hubs).not.toContain Enterprises.enterprises[3]
+
+  it "only includes visible enterprises in producers array", ->
+    expect(Enterprises.producers).toContain Enterprises.enterprises[4]
+    expect(Enterprises.producers).not.toContain Enterprises.enterprises[7]
+
+  it "includes hub, hub_profile, producer_hub and, producer_shop enterprises in hubs array", ->
+    expect(Enterprises.hubs).toContain Enterprises.enterprises[0]
+    expect(Enterprises.hubs).toContain Enterprises.enterprises[2]
+    expect(Enterprises.hubs).toContain Enterprises.enterprises[4]
+    expect(Enterprises.hubs).toContain Enterprises.enterprises[5]
+
+  it "includes producer_hub, producer_shop and producer enterprises in producers array", ->
+    expect(Enterprises.producers).toContain Enterprises.enterprises[4]
+    expect(Enterprises.producers).toContain Enterprises.enterprises[5]
+    expect(Enterprises.producers).toContain Enterprises.enterprises[6]

    {id: 1, name: "test"}
  ]
  enterprises = [
    {id: 1, visible: true, is_distributor: true, is_primary_producer: false, producers: [{id: 2}], taxons: [{id: 1}]},
    {id: 2, visible: true, is_distributor: false, is_primary_producer: true, hubs: [{id: 1}]},
    {id: 3, visible: true, is_distributor: false, is_primary_producer: true, hubs: [{id: 1}]}
  ]
  beforeEach ->
    module 'Darkswarm'
    module ($provide)->

    expect(Enterprises.enterprises[0]).toBe Enterprises.enterprises_by_id["1"]

  it "dereferences references to other enterprises", ->
    expect(Enterprises.enterprises_by_id["1"].producers[0]).toBe enterprises[4]
    expect(Enterprises.enterprises_by_id["5"].hubs[0]).toBe enterprises[0]

  it "dereferences taxons", ->
    expect(Enterprises.enterprises[0].taxons[0]).toBe taxons[0]
