diff options
| author | Misko Hevery | 2010-05-07 12:09:14 -0700 |
|---|---|---|
| committer | Misko Hevery | 2010-05-07 12:09:14 -0700 |
| commit | 038a743e6f49c347a38edc0e54dcbb175905a475 (patch) | |
| tree | 8eb10232c94967159175bde5a9209aaf5ba07c67 /test/servicesSpec.js | |
| parent | ac1d02d0658cb74ae3822e364f84809d78cda335 (diff) | |
| download | angular.js-038a743e6f49c347a38edc0e54dcbb175905a475.tar.bz2 | |
xhr bulk fixes
Diffstat (limited to 'test/servicesSpec.js')
| -rw-r--r-- | test/servicesSpec.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/servicesSpec.js b/test/servicesSpec.js index 112fc374..794d1120 100644 --- a/test/servicesSpec.js +++ b/test/servicesSpec.js @@ -149,6 +149,7 @@ describe("service", function(){ expect(scope.$route.current).toEqual(null); scope.$route.when('/NONE', {template:'instant update'}); + scope.$eval(); expect(scope.$route.current.template).toEqual('instant update'); }); }); @@ -187,7 +188,7 @@ describe("service", function(){ describe('bulk', function(){ it('should collect requests', function(){ - scope.$xhr.bulk.url = "/"; + scope.$xhr.bulk.urls["/"] = {match:/.*/}; scope.$xhr.bulk('GET', '/req1', null, callback); scope.$xhr.bulk('POST', '/req2', {post:'data'}, callback); @@ -225,7 +226,11 @@ describe("service", function(){ }); it('should keep track of in flight requests and request only once', function(){ - cache.delegate = scope.$xhr.bulk; + scope.$xhr.bulk.urls['/bulk'] = { + match:function(url){ + return url == '/url'; + } + }; xhr.expectPOST('/bulk', { requests:[{method:'GET', url:'/url', data: null}] }).respond([ |
