From c9f2b1eec5e8a9eaf10faae8a8accf0b771096e0 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Thu, 24 Nov 2011 19:28:09 -0800 Subject: feat(form): do not prevent submission if action attribute present --- test/widget/formSpec.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/widget') diff --git a/test/widget/formSpec.js b/test/widget/formSpec.js index 7a92dbf4..f2e90d9e 100644 --- a/test/widget/formSpec.js +++ b/test/widget/formSpec.js @@ -29,6 +29,22 @@ describe('form', function() { })); + it('should not prevent form submission if action attribute present', + inject(function($compile, $rootScope) { + var callback = jasmine.createSpy('submit').andCallFake(function(event) { + expect(event.isDefaultPrevented()).toBe(false); + event.preventDefault(); + }); + + doc = angular.element('
'); + $compile(doc)($rootScope); + doc.bind('submit', callback); + + browserTrigger(doc, 'submit'); + expect(callback).toHaveBeenCalledOnce(); + })); + + it('should publish form to scope', inject(function($rootScope, $compile) { doc = angular.element('
'); $compile(doc)($rootScope); -- cgit v1.2.3