summaryrefslogtreecommitdiffstatshomepage
path: root/test/attributes/hx-put.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/attributes/hx-put.js')
-rw-r--r--test/attributes/hx-put.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/attributes/hx-put.js b/test/attributes/hx-put.js
index ad347da6..a1d47bcc 100644
--- a/test/attributes/hx-put.js
+++ b/test/attributes/hx-put.js
@@ -20,4 +20,17 @@ describe("hx-put attribute", function(){
this.server.respond();
btn.innerHTML.should.equal("Putted!");
});
+
+ it('issues a PUT request with proper headers', function()
+ {
+ this.server.respondWith("PUT", "/test", function(xhr){
+ xhr.requestHeaders['X-HTTP-Method-Override'].should.equal('PUT');
+ xhr.respond(200, {}, "Putted!");
+ });
+
+ var btn = make('<button data-hx-put="/test">Click Me!</button>')
+ btn.click();
+ this.server.respond();
+ btn.innerHTML.should.equal("Putted!");
+ });
})