From 94baabb3fbbf61ae2d224fe2a7bd02f0c433eefb Mon Sep 17 00:00:00 2001 From: Jake Harding Date: Sun, 2 Feb 2014 13:43:44 -0800 Subject: [PATCH] Expect HTTP method to be set through type, not method. Fixes #630. --- src/bloodhound/options_parser.js | 4 ++-- test/bloodhound_spec.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bloodhound/options_parser.js b/src/bloodhound/options_parser.js index 42c5d813..e5a05627 100644 --- a/src/bloodhound/options_parser.js +++ b/src/bloodhound/options_parser.js @@ -34,7 +34,7 @@ var oParser = (function() { prefetch = _.mixin(defaults, prefetch); prefetch.thumbprint = VERSION + prefetch.thumbprint; - prefetch.ajax.method = prefetch.ajax.method || 'get'; + prefetch.ajax.type = prefetch.ajax.type || 'GET'; prefetch.ajax.dataType = prefetch.ajax.dataType || 'json'; !prefetch.url && $.error('prefetch requires url to be set'); @@ -65,7 +65,7 @@ var oParser = (function() { remote.rateLimiter = /^throttle$/i.test(remote.rateLimitBy) ? byThrottle(remote.rateLimitWait) : byDebounce(remote.rateLimitWait); - remote.ajax.method = remote.ajax.method || 'get'; + remote.ajax.type = remote.ajax.type || 'GET'; remote.ajax.dataType = remote.ajax.dataType || 'json'; delete remote.rateLimitBy; diff --git a/test/bloodhound_spec.js b/test/bloodhound_spec.js index 57ffc1d1..325851fa 100644 --- a/test/bloodhound_spec.js +++ b/test/bloodhound_spec.js @@ -205,13 +205,13 @@ describe('Bloodhound', function() { expect(this.bloodhound1.transport.get).toHaveBeenCalledWith( '/test?q=one%20two', - { method: 'get', dataType: 'json' }, + { type: 'GET', dataType: 'json' }, jasmine.any(Function) ); expect(this.bloodhound2.transport.get).toHaveBeenCalledWith( '/test?q=one two', - { method: 'get', dataType: 'json' }, + { type: 'GET', dataType: 'json' }, jasmine.any(Function) ); });