From c25cb7d48872fbb37b68f57c9c493ed8bb86a140 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Tue, 7 Aug 2012 17:23:16 -0700 Subject: refactor(formSpec): group preventDefault specs into a describe --- test/ng/directive/formSpec.js | 63 ++++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 30 deletions(-) (limited to 'test') diff --git a/test/ng/directive/formSpec.js b/test/ng/directive/formSpec.js index 8b87f266..fa047480 100644 --- a/test/ng/directive/formSpec.js +++ b/test/ng/directive/formSpec.js @@ -64,36 +64,6 @@ describe('form', function() { }); - it('should prevent form submission', function() { - var startingUrl = '' + window.location; - doc = jqLite('
')(scope); - doc.bind('submit', callback); - - browserTrigger(doc, 'submit'); - expect(callback).toHaveBeenCalledOnce(); - }); - - it('should publish form to scope when name attr is defined', function() { doc = $compile('')(scope); expect(scope.myForm).toBeTruthy(); @@ -155,6 +125,39 @@ describe('form', function() { }); + describe('preventing default submission', function() { + + it('should prevent form submission', function() { + var startingUrl = '' + window.location; + doc = jqLite('')(scope); + doc.bind('submit', callback); + + browserTrigger(doc, 'submit'); + expect(callback).toHaveBeenCalledOnce(); + }); + }); + + describe('nested forms', function() { it('should chain nested forms', function() { -- cgit v1.2.3