Fix failed adds a new tag rule js test

This commit is contained in:
Bing Xie
2016-06-01 16:02:12 +10:00
parent d424c2eb20
commit a39d15d685

View File

@@ -15,6 +15,7 @@ describe "TagRulesCtrl", ->
inject ($rootScope, $controller) ->
scope = $rootScope
scope.enterprise_form = jasmine.createSpyObj('enterprise_form', ['$setDirty'])
ctrl = $controller 'TagRulesCtrl', {$scope: scope, enterprise: enterprise}
describe "tagGroup start indices", ->
@@ -27,6 +28,8 @@ describe "TagRulesCtrl", ->
scope.addNewRuleTo(scope.tagGroups[0], "DiscountOrder")
it "adds a new rule of the specified type to the rules array for the tagGroup", ->
expect(scope.enterprise_form.$setDirty).toHaveBeenCalled()
expect(scope.tagGroups[0].rules.length).toEqual 3
expect(scope.tagGroups[0].rules[2].type).toEqual "TagRule::DiscountOrder"