From 04a4d8b061d98f46dc97fb550d388d248845b369 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 22 Oct 2010 16:44:14 -0700 Subject: adding ng:submit directive for use with forms - allows for binding angular expressions to onsubmit events - prevent default submit action (page reload) --- test/directivesSpec.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') diff --git a/test/directivesSpec.js b/test/directivesSpec.js index 341e9031..0e99a63f 100644 --- a/test/directivesSpec.js +++ b/test/directivesSpec.js @@ -195,6 +195,20 @@ describe("directives", function(){ }); }); + + describe('ng:submit', function() { + it('should get called on form submit', function() { + var scope = compile('
' + + '' + + '
'); + scope.$eval(); + expect(scope.submitted).not.toBeDefined(); + + browserTrigger(element.children()[0]); + expect(scope.submitted).toEqual(true); + }); + }); + it('should ng:class', function(){ var scope = compile('
'); scope.$eval(); -- cgit v1.2.3