From bb98ae14f2aef74efbd8345e93f62ac67f460f7f Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Tue, 23 Mar 2010 14:57:11 -0700 Subject: markup now wroks, some refactorings --- test/markupSpec.js | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 test/markupSpec.js (limited to 'test/markupSpec.js') diff --git a/test/markupSpec.js b/test/markupSpec.js new file mode 100644 index 00000000..9e89af7b --- /dev/null +++ b/test/markupSpec.js @@ -0,0 +1,49 @@ +describe("markups", function(){ + + var compile, element, scope; + + beforeEach(function() { + scope = null; + element = null; + var compiler = new Compiler(angularTextMarkup, angularAttrMarkup, angularDirective, angularWidget); + compile = function(html) { + element = jqLite(html); + var view = compiler.compile(element)(element); + view.init(); + scope = view.scope; + }; + }); + + afterEach(function(){ + if (element) { + element.remove(); + } + expect(_(jqCache).size()).toEqual(0); + }); + + it('should translate {{}} in text', function(){ + compile('
');
+ expect(element.attr('src')).toEqual();
+ expect(element.attr('ng-bind-attr')).toEqual('{"src":"http://server/{{path}}.png"}');
+ scope.set('path', 'a/b');
+ scope.updateView();
+ expect(element.attr('src')).toEqual("http://server/a/b.png");
+ });
+
+});
--
cgit v1.2.3