diff --git a/lib/google-places.js b/lib/google-places.js index bdf74e6..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, { - reference: options.reference, + placeid: options.place_id, sensor: false, language: 'en' }); diff --git a/test/index.test.js b/test/index.test.js index f7637e0..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?reference=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"}' }); @@ -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);