Skip to content

Commit

Permalink
Added more acceptance tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
rvernagus committed Feb 10, 2013
1 parent d59ace0 commit 3c45025
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions acceptanceTest/geoservices.acceptanceTest.js
Expand Up @@ -19,5 +19,62 @@ describe('geoservices', function() {
done();
});
});

it('map service (root)', function(done) {
var options = {
host: 'sampleserver1.arcgisonline.com',
path: '/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer'
};
geoservices.get(options, function(result) {
assert.equal(result.currentVersion, 10.01);
assert.equal(result.layers.length, 3);
assert.deepEqual(result.spatialReference, {wkid: 4326});
assert.equal(result.units, 'esriDecimalDegrees');
assert.equal(result.documentInfo.Title, 'USA_Data');
done();
});
});

it('map service export', function(done) {
var options = {
host: 'sampleserver1.arcgisonline.com',
path: '/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer/export',
params: {
bbox: '-115.8,30.4,-85.5,50.5',
size: '800,600',
imageSR: 102004,
format: 'gif',
transparent: false
}
};
geoservices.get(options, function(result) {
assert.equal(result.width, 800);
assert.equal(result.height, 600);
assert.deepEqual(result.extent.spatialReference, {wkid: 102004});
done();
});
});

it('map service identify', function(done) {
var options = {
host: 'sampleserver1.arcgisonline.com',
path: '/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer/identify',
params: {
geometryType: 'esriGeometryPoint',
geometry: {x: -120, y: 40},
layers: 'all:2',
tolerance: 10,
mapExtent: '-119,38,-121,41',
imageDisplay: '400,300,96',
returnGeometry: true
}
};
geoservices.get(options, function(result) {
console.log(result);
var geoJsonResult = geoservices.convert.toGeoJSON(result.results);
console.log(geoJsonResult);
done();
});
})
});
});

0 comments on commit 3c45025

Please sign in to comment.