diff --git a/test/lib/agent/providers/geo/geoip_strategy.js b/test/lib/agent/providers/geo/geoip_strategy.js index 18decad31..35728952d 100644 --- a/test/lib/agent/providers/geo/geoip_strategy.js +++ b/test/lib/agent/providers/geo/geoip_strategy.js @@ -1,6 +1,6 @@ var helpers = require('./../../../../helpers'), - should = require('should'), - geoip_strat = helpers.load('providers/geo/strategies').geoip; + should = require('should'), + geoip_strat = helpers.load('providers/geo/strategies').geoip; describe('geoip', function () { diff --git a/test/lib/agent/providers/geo/google_strategy.js b/test/lib/agent/providers/geo/google_strategy.js index b1c7e58d0..293a2d6d0 100644 --- a/test/lib/agent/providers/geo/google_strategy.js +++ b/test/lib/agent/providers/geo/google_strategy.js @@ -1,15 +1,31 @@ var helpers = require('./../../../../helpers'), - should = require('should'), - google_strat = helpers.load('providers/geo/strategies').google, - location_response = require('../fixtures/google_location_response'); + should = require('should'), + google_strat = helpers.load('providers/geo/strategies').google, + location_response = require('../fixtures/google_location_response'); describe('location', function() { - describe('when access points return error', function() { + describe('when access points list return error', function() { - }); + var provider_stub = {}, + error = new Error('No access points found.'); + + before(function() { + provider_stub = helpers.stub_provider('access_points_list', error, null); + }); + + after(function() { + provider_stub.restore(); + }); - describe('when access points list is empty', function() { + it('returns error', function(done) { + google_strat(function(err, res) { + should(res).not.exist; + err.should.exist; + err.should.equal(error); + done(); + }); + }); });