aboutsummaryrefslogtreecommitdiffstats
path: root/test/scenario/dslSpec.js
diff options
context:
space:
mode:
authorIgor Minar2010-11-02 16:26:59 -0700
committerIgor Minar2010-11-03 09:47:21 -0700
commitaec3c8478c2eb937e24306087c5bc1ef49722036 (patch)
treeb88261c07dea2ac3c3ac4fcdc38bab8eb3216610 /test/scenario/dslSpec.js
parent5c887ddb66bdd0daa4f4a98af0c6e76d4aec0d70 (diff)
downloadangular.js-aec3c8478c2eb937e24306087c5bc1ef49722036.tar.bz2
binding() should return value for input/text area, innerHTML for the rest
Diffstat (limited to 'test/scenario/dslSpec.js')
-rw-r--r--test/scenario/dslSpec.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/scenario/dslSpec.js b/test/scenario/dslSpec.js
index 0338e884..881d629c 100644
--- a/test/scenario/dslSpec.js
+++ b/test/scenario/dslSpec.js
@@ -376,6 +376,24 @@ describe("angular.scenario.dsl", function() {
expect($root.futureResult).toEqual('some value');
});
+ it('should return value for input elements', function() {
+ doc.append('<input type="text" class="ng-binding" ng:bind="foo.bar" value="some value"/>');
+ $root.dsl.binding('foo.bar');
+ expect($root.futureResult).toEqual('some value');
+ });
+
+ it('should return value for textarea elements', function() {
+ doc.append('<textarea class="ng-binding" ng:bind="foo.bar">some value</textarea>');
+ $root.dsl.binding('foo.bar');
+ expect($root.futureResult).toEqual('some value');
+ });
+
+ it('should return innerHTML for all the other elements', function() {
+ doc.append('<div class="ng-binding" ng:bind="foo.bar">some <b>value</b></div>');
+ $root.dsl.binding('foo.bar');
+ expect($root.futureResult).toEqual('some <b>value</b>');
+ });
+
it('should select binding in template by name', function() {
doc.append('<pre class="ng-binding" ng:bind-template="foo {{bar}} baz">foo some baz</pre>');
$root.dsl.binding('bar');