diff options
| author | Igor Minar | 2011-04-04 16:04:37 -0700 | 
|---|---|---|
| committer | Igor Minar | 2011-04-04 16:04:37 -0700 | 
| commit | 754d2541c41080ba8d2a20cbe04ce16b1742296f (patch) | |
| tree | b382a4aa7795550792f56677936a078e8b20bd08 /test | |
| parent | 9bd2c3967ba210cd349299a7546854eccc619e96 (diff) | |
| download | angular.js-754d2541c41080ba8d2a20cbe04ce16b1742296f.tar.bz2 | |
correct $resource's success callback execution
succcess callbacks should be executed for status codes in the range
of <200,300).
Diffstat (limited to 'test')
| -rw-r--r-- | test/ResourceSpec.js | 11 | 
1 files changed, 9 insertions, 2 deletions
diff --git a/test/ResourceSpec.js b/test/ResourceSpec.js index e055beab..fe6c3fdf 100644 --- a/test/ResourceSpec.js +++ b/test/ResourceSpec.js @@ -139,13 +139,20 @@ describe("resource", function() {      expect(log).toEqual('cb;');    }); -  it('should delete resource', function(){ -    xhr.expectDELETE("/CreditCard/123").respond({}); +  it('should delete resource and call callback', function(){ +    xhr.expectDELETE("/CreditCard/123").respond(200, {});      CreditCard.remove({id:123}, callback);      expect(callback).wasNotCalled();      xhr.flush();      nakedExpect(callback.mostRecentCall.args).toEqual([{}]); + +    callback.reset(); +    xhr.expectDELETE("/CreditCard/333").respond(204, null); +    CreditCard.remove({id:333}, callback); +    expect(callback).wasNotCalled(); +    xhr.flush(); +    nakedExpect(callback.mostRecentCall.args).toEqual([{}]);    });    it('should post charge verb', function(){  | 
