diff options
Diffstat (limited to 'test/ng/directive/ngEventDirsSpec.js')
| -rw-r--r-- | test/ng/directive/ngEventDirsSpec.js | 25 | 
1 files changed, 25 insertions, 0 deletions
diff --git a/test/ng/directive/ngEventDirsSpec.js b/test/ng/directive/ngEventDirsSpec.js new file mode 100644 index 00000000..c42f9b26 --- /dev/null +++ b/test/ng/directive/ngEventDirsSpec.js @@ -0,0 +1,25 @@ +'use strict'; + +describe('event directives', function() { +  var element; + + +  afterEach(function() { +    dealoc(element); +  }); + + +  describe('ng-submit', function() { + +    it('should get called on form submit', inject(function($rootScope, $compile) { +      element = $compile('<form action="" ng-submit="submitted = true">' + +        '<input type="submit"/>' + +        '</form>')($rootScope); +      $rootScope.$digest(); +      expect($rootScope.submitted).not.toBeDefined(); + +      browserTrigger(element.children()[0]); +      expect($rootScope.submitted).toEqual(true); +    })); +  }); +});  | 
