aboutsummaryrefslogtreecommitdiffstats
path: root/test/scenario/dslSpec.js
diff options
context:
space:
mode:
authorElliott Sprehn2010-10-27 17:56:44 -0700
committerElliott Sprehn2010-10-27 17:56:44 -0700
commit92e31b556fcaeea7e7078c63729287dbdfcf09ff (patch)
tree86ba209b7abed2ca65ac7955e031ee447298fa90 /test/scenario/dslSpec.js
parent62c0e5c46091d8b98a20c31ab26e715bad574bae (diff)
downloadangular.js-92e31b556fcaeea7e7078c63729287dbdfcf09ff.tar.bz2
Correctly fail tests if no binding matches and add better test cases for failure behavior.
Diffstat (limited to 'test/scenario/dslSpec.js')
-rw-r--r--test/scenario/dslSpec.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/scenario/dslSpec.js b/test/scenario/dslSpec.js
index 3d68925f..d21c1bb9 100644
--- a/test/scenario/dslSpec.js
+++ b/test/scenario/dslSpec.js
@@ -271,7 +271,19 @@ describe("angular.scenario.dsl", function() {
expect($root.futureResult).toEqual('foo some baz');
});
- it('should return error if no binding exists', function() {
+ it('should match bindings by substring match', function() {
+ doc.append('<pre class="ng-binding" ng:bind="foo.bar() && test.baz() | filter">binding value</pre>');
+ $root.dsl.binding('test.baz');
+ expect($root.futureResult).toEqual('binding value');
+ });
+
+ it('should return error if no bindings in document', function() {
+ $root.dsl.binding('foo.bar');
+ expect($root.futureError).toMatch(/did not match/);
+ });
+
+ it('should return error if no binding matches', function() {
+ doc.append('<span class="ng-binding" ng:bind="foo">some value</span>');
$root.dsl.binding('foo.bar');
expect($root.futureError).toMatch(/did not match/);
});