aboutsummaryrefslogtreecommitdiffstats
path: root/test/directive/ngEventDirsSpec.js
diff options
context:
space:
mode:
authorIgor Minar2012-03-08 15:00:38 -0800
committerIgor Minar2012-03-08 22:29:34 -0800
commitf54db2ccda399f2677e4ca7588018cb31545a2b4 (patch)
tree29ef2f8f834544c84cea1a82e3d08679358fb992 /test/directive/ngEventDirsSpec.js
parentdd7b0f56fcd9785f7fccae8c4f088a8f3e7b125e (diff)
downloadangular.js-f54db2ccda399f2677e4ca7588018cb31545a2b4.tar.bz2
chore(directives,widgets): reorg the code under directive/ dir
Diffstat (limited to 'test/directive/ngEventDirsSpec.js')
-rw-r--r--test/directive/ngEventDirsSpec.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/directive/ngEventDirsSpec.js b/test/directive/ngEventDirsSpec.js
new file mode 100644
index 00000000..2b14bb33
--- /dev/null
+++ b/test/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);
+ }));
+ });
+});