Permalink
Browse files

Add test for prepend

  • Loading branch information...
1 parent e4615d2 commit a840f224e43ac2188ee2a2ba848d9eb27448d1bc @ericclemmons committed Mar 27, 2013
Showing with 28 additions and 2 deletions.
  1. +8 −0 Gruntfile.js
  2. +12 −2 test/angular-templates_test.js
  3. +8 −0 test/expected/simple_prepend.js
View
@@ -50,6 +50,14 @@ module.exports = function(grunt) {
},
src: ['test/fixtures/simple.html'],
dest: 'tmp/simple.js'
+ },
+ prepend: {
+ options: {
+ base: 'test/fixtures',
+ prepend: '/prepend/'
+ },
+ src: ['test/fixtures/simple.html'],
+ dest: 'tmp/simple_prepend.js'
}
}
});
@@ -11,7 +11,7 @@ exports.ngtemplates = {
var actual = grunt.file.read('tmp/simple.js');
var expected = grunt.file.read('test/expected/simple.js');
- test.equal(expected, actual, 'should compile template as module `simple.templates`');
+ test.equal(expected, actual, 'should compile template as module `simple`');
test.done();
},
@@ -21,7 +21,17 @@ exports.ngtemplates = {
var actual = grunt.file.read('tmp/multiple.js');
var expected = grunt.file.read('test/expected/multiple.js');
- test.equal(expected, actual, 'should compile multiple templates together as `multiple.templates`');
+ test.equal(expected, actual, 'should compile multiple templates together as `multiple`');
+ test.done();
+ },
+
+ prepend: function(test) {
+ test.expect(1);
+
+ var actual = grunt.file.read('tmp/simple_prepend.js');
+ var expected = grunt.file.read('test/expected/simple_prepend.js');
+
+ test.equal(expected, actual, 'should prepend $templateCache ID with /prepend/simple.html"');
test.done();
}
@@ -0,0 +1,8 @@
+angular.module("prepend").run(["$templateCache", function($templateCache) {
+
+ $templateCache.put("/prepend/simple.html",
+ "Howdy there! \\ Your name is \"{{ name }}\"." +
+ ""
+ );
+
+}]);

0 comments on commit a840f22

Please sign in to comment.