diff options
| author | Jen Bourey | 2013-10-04 12:02:18 -0700 |
|---|---|---|
| committer | Jeff Cross | 2013-10-04 16:50:08 -0700 |
| commit | 8336b3a286f8469d4cd7c412c41ca8c1a31fecf0 (patch) | |
| tree | 95c1b3a8340226b7a1cd6d495bea8cda03930ac0 /test | |
| parent | 49e06eace58d871972f0cf3ec92aa28e19c4b02b (diff) | |
| download | angular.js-8336b3a286f8469d4cd7c412c41ca8c1a31fecf0.tar.bz2 | |
fix(ngResource): Remove request body from $delete
Prevent the obj.$delete instance method from sending the resource as the request body. This commit uses the existing hasBody boolean to only set httpConfig.data for methods which should have a request body.
Closes #4280
Diffstat (limited to 'test')
| -rw-r--r-- | test/ngResource/resourceSpec.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ngResource/resourceSpec.js b/test/ngResource/resourceSpec.js index 2bf40a2c..550b4432 100644 --- a/test/ngResource/resourceSpec.js +++ b/test/ngResource/resourceSpec.js @@ -32,6 +32,16 @@ describe("resource", function() { }); + it('should not include a request body when calling $delete', function() { + $httpBackend.expect('DELETE', '/fooresource', null).respond({}); + var Resource = $resource('/fooresource'); + var resource = new Resource({ foo: 'bar' }); + + resource.$delete(); + $httpBackend.flush(); + }); + + it("should build resource", function() { expect(typeof CreditCard).toBe('function'); expect(typeof CreditCard.get).toBe('function'); |
