From 92e31b556fcaeea7e7078c63729287dbdfcf09ff Mon Sep 17 00:00:00 2001 From: Elliott Sprehn Date: Wed, 27 Oct 2010 17:56:44 -0700 Subject: Correctly fail tests if no binding matches and add better test cases for failure behavior. --- test/scenario/dslSpec.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'test/scenario') 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('
binding value'); + $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('some value'); $root.dsl.binding('foo.bar'); expect($root.futureError).toMatch(/did not match/); }); -- cgit v1.2.3