aboutsummaryrefslogtreecommitdiffstats
path: root/test/ngResource/resourceSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/ngResource/resourceSpec.js')
-rw-r--r--test/ngResource/resourceSpec.js16
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();