diff options
Diffstat (limited to 'test/scenario/FutureSpec.js')
| -rw-r--r-- | test/scenario/FutureSpec.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/scenario/FutureSpec.js b/test/scenario/FutureSpec.js index 52bd9c66..827c4b35 100644 --- a/test/scenario/FutureSpec.js +++ b/test/scenario/FutureSpec.js @@ -1,6 +1,6 @@ describe('angular.scenario.Future', function() { var future; - + it('should set the sane defaults', function() { var behavior = function() {}; var future = new angular.scenario.Future('test name', behavior, 'foo'); @@ -11,7 +11,7 @@ describe('angular.scenario.Future', function() { expect(future.fulfilled).toBeFalsy(); expect(future.parser).toEqual(angular.identity); }); - + it('should be fulfilled after execution and done callback', function() { var future = new angular.scenario.Future('test name', function(done) { done(); @@ -19,7 +19,7 @@ describe('angular.scenario.Future', function() { future.execute(angular.noop); expect(future.fulfilled).toBeTruthy(); }); - + it('should take callback with (error, result) and forward', function() { var future = new angular.scenario.Future('test name', function(done) { done(10, 20); @@ -29,7 +29,7 @@ describe('angular.scenario.Future', function() { expect(result).toEqual(20); }); }); - + it('should use error as value if provided', function() { var future = new angular.scenario.Future('test name', function(done) { done(10, 20); @@ -37,7 +37,7 @@ describe('angular.scenario.Future', function() { future.execute(angular.noop); expect(future.value).toEqual(10); }); - + it('should parse json with fromJson', function() { var future = new angular.scenario.Future('test name', function(done) { done(null, "{test: 'foo'}"); @@ -45,7 +45,7 @@ describe('angular.scenario.Future', function() { future.fromJson().execute(angular.noop); expect(future.value).toEqual({test: 'foo'}); }); - + it('should convert to json with toJson', function() { var future = new angular.scenario.Future('test name', function(done) { done(null, {test: 'foo'}); @@ -53,7 +53,7 @@ describe('angular.scenario.Future', function() { future.toJson().execute(angular.noop); expect(future.value).toEqual('{"test":"foo"}'); }); - + it('should convert with custom parser', function() { var future = new angular.scenario.Future('test name', function(done) { done(null, 'foo'); @@ -63,7 +63,7 @@ describe('angular.scenario.Future', function() { }).execute(angular.noop); expect(future.value).toEqual('FOO'); }); - + it('should pass error if parser fails', function() { var future = new angular.scenario.Future('test name', function(done) { done(null, '{'); @@ -71,5 +71,5 @@ describe('angular.scenario.Future', function() { future.fromJson().execute(function(error, result) { expect(error).toBeDefined(); }); - }); + }); }); |
