diff options
| author | Max Martinsson | 2012-05-17 17:11:25 +0200 | 
|---|---|---|
| committer | Misko Hevery | 2012-09-06 16:06:21 -0700 | 
| commit | fbdab513dd48f667ad857030cf4b3481ecdd9097 (patch) | |
| tree | 72b0d82c3af91305a55906016c46123ddaf20b21 /test/ngResource | |
| parent | f2b7fffdc0b0ad80cebb24f5fea743e9e4a439d5 (diff) | |
| download | angular.js-fbdab513dd48f667ad857030cf4b3481ecdd9097.tar.bz2 | |
feat($resource): support custom headers per action
Closes #736
Diffstat (limited to 'test/ngResource')
| -rw-r--r-- | test/ngResource/resourceSpec.js | 16 | 
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ngResource/resourceSpec.js b/test/ngResource/resourceSpec.js index 2981732c..e6bab249 100644 --- a/test/ngResource/resourceSpec.js +++ b/test/ngResource/resourceSpec.js @@ -14,7 +14,14 @@ describe("resource", function() {        },        patch: {          method: 'PATCH' +      }, +      conditionalPut: { +        method: 'PUT', +        headers: { +          'If-None-Match': '*' +        }        } +      });      callback = jasmine.createSpy();    })); @@ -146,6 +153,15 @@ describe("resource", function() {    }); +  it('should send correct headers', function() { +    $httpBackend.expectPUT('/CreditCard/123', undefined, function(headers) { +       return headers['If-None-Match'] == "*"; +    }).respond({id:123}); + +    CreditCard.conditionalPut({id: {key:123}}); +  }); + +    it("should read partial resource", function() {      $httpBackend.expect('GET', '/CreditCard').respond([{id:{key:123}}]);      var ccs = CreditCard.query();  | 
