Skip to content

Commit

Permalink
Add specs to google geoloc for when access_point_list returns error.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricioschneider committed Jul 14, 2015
1 parent b8f14ca commit a192d17
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
4 changes: 2 additions & 2 deletions test/lib/agent/providers/geo/geoip_strategy.js
Original file line number Diff line number Diff line change
@@ -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 () {

Expand Down
28 changes: 22 additions & 6 deletions test/lib/agent/providers/geo/google_strategy.js
Original file line number Diff line number Diff line change
@@ -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();
});
});

});

Expand Down

0 comments on commit a192d17

Please sign in to comment.