extract testApp into own file
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 21 Jan 2013 23:40:00 +0000 (00:40 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 21 Jan 2013 23:40:00 +0000 (00:40 +0100)
app/drzb2013.html.ep
test/e2e/testApp.js [new file with mode: 0644]

index a3b1404..b478ccc 100644 (file)
 
 % if ( $test ) {
   <script src="/test/lib/angular/angular-mocks.js"></script>
-  <script type="text/javascript">
-// https://groups.google.com/forum/?fromgroups=#!searchin/angular/e2e$20mock|sort:date/angular/ObdxCoCObYU/KENkGVfIZYkJ
-
-angular.module('testApp', ['myApp', 'ngMockE2E' ]).
-       run(function ($httpBackend) {
-               console.log('mock $httpBackend', $httpBackend);
-               $httpBackend.whenGET(/partials\/.*/).passThrough();
-               $httpBackend.whenJSONP(/./).passThrough();
-               $httpBackend.whenGET(/registration/).passThrough();
-               $httpBackend.whenPOST(/registration/).passThrough();
-       }
-);
-
-// mock console for IE
-if(!window.console) {
-        window.console = new function() {
-                this.log = function(str) {};
-                this.info = function(str) {};
-                this.debug = function(str) {};
-        };
-}
-
-
-console.log('mock testApp');
-
-  </script>
+  <script src="/test/e2e/testApp.js"></script>
 % }
 
 </body>
diff --git a/test/e2e/testApp.js b/test/e2e/testApp.js
new file mode 100644 (file)
index 0000000..51295a7
--- /dev/null
@@ -0,0 +1,24 @@
+// https://groups.google.com/forum/?fromgroups=#!searchin/angular/e2e$20mock|sort:date/angular/ObdxCoCObYU/KENkGVfIZYkJ
+
+angular.module('testApp', ['myApp', 'ngMockE2E' ]).
+       run(function ($httpBackend) {
+               console.log('mock $httpBackend', $httpBackend);
+               $httpBackend.whenGET(/partials\/.*/).passThrough();
+               $httpBackend.whenJSONP(/./).passThrough();
+               $httpBackend.whenGET(/registration/).passThrough();
+               $httpBackend.whenPOST(/registration/).passThrough();
+       }
+);
+
+// mock console for IE
+if(!window.console) {
+        window.console = new function() {
+                this.log = function(str) {};
+                this.info = function(str) {};
+                this.debug = function(str) {};
+        };
+}
+
+
+console.log('mock testApp');
+