summaryrefslogtreecommitdiffstatshomepage
path: root/test/attributes/hx-get.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/attributes/hx-get.js')
-rw-r--r--test/attributes/hx-get.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/attributes/hx-get.js b/test/attributes/hx-get.js
index d9d3dddd..7326c39e 100644
--- a/test/attributes/hx-get.js
+++ b/test/attributes/hx-get.js
@@ -65,4 +65,12 @@ describe("hx-get attribute", function() {
});
+ it('issues a GET request on click and swaps content w/ data-* prefix', function () {
+ this.server.respondWith("GET", "/test", "Clicked!");
+
+ var btn = make('<button data-hx-get="/test">Click Me!</button>')
+ btn.click();
+ this.server.respond();
+ btn.innerHTML.should.equal("Clicked!");
+ });
}); \ No newline at end of file