First cut at an interface for updating tag rules

This commit is contained in:
Rob Harrington
2016-03-10 12:09:27 +11:00
parent 3aea387b9a
commit 066190c16f
17 changed files with 172 additions and 7 deletions

View File

@@ -0,0 +1,25 @@
describe "TagRulesCtrl", ->
ctrl = null
scope = null
enterprise = null
beforeEach ->
module('admin.enterprises')
enterprise =
tag_rules: [
{ id: 1, preferred_customer_tags: "member" },
{ id: 2, preferred_customer_tags: "member" },
{ id: 3, preferred_customer_tags: "local" }
]
inject ($rootScope, $controller) ->
scope = $rootScope
scope.Enterprise = enterprise
ctrl = $controller 'TagRulesCtrl', {$scope: scope}
describe "initialization", ->
it "groups rules by preferred_customer_tags", ->
expect(scope.groupedTagRules).toEqual {
member: [{ id: 1, preferred_customer_tags: "member" }, { id: 2, preferred_customer_tags: "member" }],
local: [{ id: 3, preferred_customer_tags: "local" }]
}