aboutsummaryrefslogtreecommitdiffstats
path: root/test/ResourceSpec.js
diff options
context:
space:
mode:
authorIgor Minar2011-11-24 03:53:04 -0800
committerIgor Minar2011-11-30 14:49:35 -0500
commitdbd880cc0a9521bd5b9c96ca3f052450c3def336 (patch)
treefc524b84aab7ea1f67ff14962ea31f1e735f628c /test/ResourceSpec.js
parentbf8e0540f8195edbaaa3d0138bd6a26e79e1ab58 (diff)
downloadangular.js-dbd880cc0a9521bd5b9c96ca3f052450c3def336.tar.bz2
feat($http): add promise support
quite messy, some tests are missing, contains an experimental jasmine DI support)
Diffstat (limited to 'test/ResourceSpec.js')
-rw-r--r--test/ResourceSpec.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/ResourceSpec.js b/test/ResourceSpec.js
index 7987af04..6045bd30 100644
--- a/test/ResourceSpec.js
+++ b/test/ResourceSpec.js
@@ -261,13 +261,14 @@ describe("resource", function() {
errorCB;
beforeEach(function() {
- errorCB = jasmine.createSpy('error').andCallFake(function(response, status) {
- expect(response).toBe(ERROR_RESPONSE);
- expect(status).toBe(ERROR_CODE);
+ errorCB = jasmine.createSpy('error').andCallFake(function(response) {
+ expect(response.data).toBe(ERROR_RESPONSE);
+ expect(response.status).toBe(ERROR_CODE);
});
});
- it('should call the error callback if provided on non 2xx response', inject(function($httpBackend) {
+ it('should call the error callback if provided on non 2xx response',
+ inject(function($httpBackend, $rootScope) {
$httpBackend.expect('GET', '/CreditCard/123').respond(ERROR_CODE, ERROR_RESPONSE);
CreditCard.get({id:123}, callback, errorCB);