 beforeEach(module('taiga.services.filters'))
 
 describe "$gmFilters", ->
-    it "Check if filter is selected", inject(($gmFilters) ->
+
+    $rootScope = null
+    $gmFilters = null
+
+    beforeEach(inject((_$rootScope_, _$gmFilters_) ->
+        $rootScope = _$rootScope_
+        $gmFilters = _$gmFilters_
+    ))
+
+
+    it "Check if filter is selected",  ->
         tag = {id:1, name: "foo", type: "bar"}
         $gmFilters.selectFilter(1, "ns1", tag)
         expect($gmFilters.isFilterSelected(1, "ns1", tag)).to.be.true
-    )
 
-    it "Check unselect filter", inject(($gmFilters) ->
+    it "Check unselect filter", ->
         tag = {id:1, name: "foo", type: "bar"}
         $gmFilters.selectFilter(1, "ns1", tag)
         $gmFilters.unselectFilter(1, "ns1", tag)
 
         expect($gmFilters.isFilterSelected(1, "ns1", tag)).to.be.false
-    )
 
-    it "Convert tag to key as text", inject(($gmFilters) ->
+    it "Convert tag to key as text", ->
         tag = {id:1, name: "foo", type: "bar"}
-        expect($gmFilters.filterToText(tag)).to.be.equal("1:foo:bar")
-    )
+        expect($gmFilters.filterToText(tag)).to.be.equal("1:bar")
 
-    it "Get selected filters", inject(($gmFilters) ->
+    it "Get selected filters", ->
         tag1 = {id:1, name: "foo1", type: "bar"}
         tag2 = {id:2, name: "foo2", type: "bar"}
 


        selected = $gmFilters.getSelectedFiltersList(1, "ns1", filtersData)
        expect(selected.length).to.be.equal(2)
    )

    it "Generate filters from generic list", inject(($gmFilters) ->
        constants = {
            1: {name: "Foo"}
            2: {name: "Bar"}

        expect(result[0].id).to.be.equal(1)
        expect(result[0].count).to.be.equal(5)
        expect(result[0].type).to.be.equal(type)

    it "Generate filters from tags list",  ->
        data = [["tag1",5], ["tag2",6]]
        result = $gmFilters.generateFiltersFromTagsList(data)

