diff options
| author | Max Martinsson | 2012-05-17 17:11:25 +0200 | 
|---|---|---|
| committer | Misko Hevery | 2012-09-06 15:49:48 -0700 | 
| commit | b936e52874fe0173c6d4ba0a84f45deac67518ac (patch) | |
| tree | 21b5dee407c2137a538b51cfbc27c7ffc3e9c82d /test | |
| parent | 0d52ff0f10157aa7d93a77abc78f6a6a6c3f6e45 (diff) | |
| download | angular.js-b936e52874fe0173c6d4ba0a84f45deac67518ac.tar.bz2 | |
feat($resource): support custom headers per action
Closes #736
Diffstat (limited to 'test')
| -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();  | 
