From 8b2b92907e3743fc1e8068f8d5796527c69475d1 Mon Sep 17 00:00:00 2001 From: John Pavlick Date: Sun, 31 Aug 2014 10:57:44 -0400 Subject: [PATCH 1/2] Swapping out reference for place_id --- lib/google-places.js | 2 +- test/index.test.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/google-places.js b/lib/google-places.js index bdf74e6..3f0fb73 100644 --- a/lib/google-places.js +++ b/lib/google-places.js @@ -95,7 +95,7 @@ GooglePlaces.prototype.nearbysearch = function(options, cb) { // Goolge place details GooglePlaces.prototype.details = function(options, cb) { options = _.defaults(options, { - reference: options.reference, + place_id: options.place_id, sensor: false, language: 'en' }); diff --git a/test/index.test.js b/test/index.test.js index f7637e0..648084c 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -17,7 +17,7 @@ fakeweb.registerUri({ }); //fake the details fakeweb.registerUri({ - uri: 'https://maps.googleapis.com/maps/api/place/details/json?reference=ABC123&sensor=false&language=en&key=fake_key', + uri: 'https://maps.googleapis.com/maps/api/place/details/json?place_id=ABC123&sensor=false&language=en&key=fake_key', body: '{"result" : {"rating": 2.5}, "status" : "OK"}' }); @@ -83,7 +83,7 @@ vows.describe('Places autocomplete').addBatch({ vows.describe('Place details').addBatch({ 'new search': { topic: function() { - new GooglePlaces('fake_key').details({reference: 'ABC123'}, this.callback); + new GooglePlaces('fake_key').details({place_id: 'ABC123'}, this.callback); }, 'should get details': function(err, response){ assert.equal(response.result.rating, 2.5); From 5d27fc1203512b29882a2ccb5c5760ad08eca536 Mon Sep 17 00:00:00 2001 From: John Pavlick Date: Sun, 31 Aug 2014 11:02:55 -0400 Subject: [PATCH 2/2] typo --- lib/google-places.js | 2 +- test/index.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/google-places.js b/lib/google-places.js index 3f0fb73..3d2087b 100644 --- a/lib/google-places.js +++ b/lib/google-places.js @@ -95,7 +95,7 @@ GooglePlaces.prototype.nearbysearch = function(options, cb) { // Goolge place details GooglePlaces.prototype.details = function(options, cb) { options = _.defaults(options, { - place_id: options.place_id, + placeid: options.place_id, sensor: false, language: 'en' }); diff --git a/test/index.test.js b/test/index.test.js index 648084c..2b3ff5b 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -17,7 +17,7 @@ fakeweb.registerUri({ }); //fake the details fakeweb.registerUri({ - uri: 'https://maps.googleapis.com/maps/api/place/details/json?place_id=ABC123&sensor=false&language=en&key=fake_key', + uri: 'https://maps.googleapis.com/maps/api/place/details/json?placeid=ABC123&sensor=false&language=en&key=fake_key', body: '{"result" : {"rating": 2.5}, "status" : "OK"}' });