Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

Commit

Permalink
feat(patch): support PATCH requests
Browse files Browse the repository at this point in the history
closes #53
  • Loading branch information
rnicholus committed Apr 4, 2015
1 parent 3e01e4c commit 53c6514
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ajax-form",
"version": "1.5.4",
"version": "1.6.0",
"authors": [
"Ray Nicholus"
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"type": "git",
"url": "https://github.com/rnicholus/ajax-form.git"
},
"version": "1.5.4"
"version": "1.6.0"
}
9 changes: 8 additions & 1 deletion test/ajax-form-tests.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
expect(ajaxForm.domReady.bind(typicalForm)).to.throw('Invalid method!');
});

it('throws an error if the method is not "get", "post" or "put"', function() {
it('throws an error if the method is not "get", "post", "put", or "patch', function() {
typicalForm.setAttribute('method', 'head');
expect(ajaxForm.domReady.bind(typicalForm)).to.throw('Invalid method!');
});
Expand All @@ -167,6 +167,13 @@

expect(typicalForm.addEventListener).to.have.been.calledWith('submit');
});

it('adds a listener to squelch submit events if the method is "patch"', function() {
typicalForm.setAttribute('method', 'patch');
ajaxForm.domReady.call(typicalForm);

expect(typicalForm.addEventListener).to.have.been.calledWith('submit');
});
});

describe('form validation', function() {
Expand Down

0 comments on commit 53c6514

Please sign in to comment.