Moving taxon filter to ID instead of name

This commit is contained in:
Will Marshall
2014-07-02 12:10:33 +10:00
committed by Rohan Mitchell
parent 8b98c72336
commit e858c0d434
2 changed files with 11 additions and 10 deletions

View File

@@ -5,11 +5,12 @@ describe 'filtering by taxons', ->
taxons: []
primary_taxon:
name: "frogs"
id: 1
}
{
taxons: [
{name: "kittens"}
{name: "puppies"}
{name: "kittens", id: 2}
{name: "puppies", id: 3}
]
}
]
@@ -21,7 +22,9 @@ describe 'filtering by taxons', ->
filterByTaxons = $filter('taxons')
it "filters by primary taxon", ->
expect(filterByTaxons(objects, "frogs")[0]).toBe objects[0]
expect(filterByTaxons(objects, 1)[0]).toBe objects[0]
it "filters by taxons", ->
expect(filterByTaxons(objects, "kittens")[0]).toBe objects[1]
expect(filterByTaxons(objects, 2)[0]).toBe objects[1]