diff --git a/bower.json b/bower.json index b6b31c2..7365758 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "ajax-form", - "version": "1.5.4", + "version": "1.6.0", "authors": [ "Ray Nicholus" ], diff --git a/package.json b/package.json index 3fee2d8..839522f 100644 --- a/package.json +++ b/package.json @@ -17,5 +17,5 @@ "type": "git", "url": "https://github.com/rnicholus/ajax-form.git" }, - "version": "1.5.4" + "version": "1.6.0" } \ No newline at end of file diff --git a/test/ajax-form-tests.html b/test/ajax-form-tests.html index c202a02..d523b28 100644 --- a/test/ajax-form-tests.html +++ b/test/ajax-form-tests.html @@ -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!'); }); @@ -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() {