aboutsummaryrefslogtreecommitdiffstats
path: root/test/ResourceSpec.js
diff options
context:
space:
mode:
authorIgor Minar2010-12-04 23:49:26 -0800
committerIgor Minar2010-12-06 16:45:59 -0800
commit011fa39c2a0b5da843395b538fc4e52e5ade8287 (patch)
treeb5cc7ee72fb2fbcc76da2588822a21c2cedb614c /test/ResourceSpec.js
parent58d0e8945d772eddbfecbe6a645b2f1c4dd38bf2 (diff)
downloadangular.js-011fa39c2a0b5da843395b538fc4e52e5ade8287.tar.bz2
add $browser.defer and $defer service and fix async xhr cache issue
- Closes #152 ($resource().query() sometimes calls callback before returning, and it shouldn't) - add $browser.defer method - add $defer service - integrate $browser.defer with outstandingRequests counter in $browser - fix all old tests that relied on buggy behavior
Diffstat (limited to 'test/ResourceSpec.js')
-rw-r--r--test/ResourceSpec.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/ResourceSpec.js b/test/ResourceSpec.js
index a026263b..6b987bd8 100644
--- a/test/ResourceSpec.js
+++ b/test/ResourceSpec.js
@@ -184,6 +184,8 @@ describe("resource", function() {
$browser.xhr.expectGET('/Person/123').respond('[\n{\nname:\n"rob"\n}\n]');
var person2 = Person.query({id:123});
+ $browser.defer.flush();
+
expect(person2[0].name).toEqual('misko');
var person2Cache = person2;
$browser.xhr.flush();