Created
August 23, 2011 19:27
-
-
Save dmitrig01/1166231 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('./support/start')(function(command) { | |
exports['test sqlite datasource'] = function() { | |
assert.response(command.servers['Core'], | |
{ url: '/api/Datasource/world?file=' + encodeURIComponent(__dirname + '/fixtures/countries.sqlite') + '&table=countries&id=world&type=sqlite&project=demo_01' }, | |
{ status: 200, body: 'foo' }, | |
function(res) { | |
var body = JSON.parse(res.body), datasource = readJSON('datasource-sqlite'); | |
datasource.url = __dirname + '/fixtures/countries.sqlite'; | |
assert.deepEqual(datasource, body); | |
} | |
); | |
}; | |
exports['test shapefile datasource'] = function() { | |
assert.response(command.servers['Core'], | |
{ url: '/api/Datasource/world?file=http%3A%2F%2Ftilemill-data.s3.amazonaws.com%2Fworld_borders_merc.zip&type=shape&id=world&project=demo_01' }, | |
{ status: 200, body: 'foo' }, | |
function(res) { | |
var body = JSON.parse(res.body); | |
assert.deepEqual(readJSON('datasource-shp'), body); | |
} | |
); | |
}; | |
exports['test shapefile datasource with features'] = function() { | |
assert.response(command.servers['Core'], | |
{ url: '/api/Datasource/world?file=http%3A%2F%2Ftilemill-data.s3.amazonaws.com%2Fworld_borders_merc.zip&type=shape&id=world&project=demo_01&features=true' }, | |
{ status: 200, body: 'foo' }, | |
function(res) { | |
var body = JSON.parse(res.body); | |
assert.deepEqual(readJSON('datasource-shp-features'), body); | |
} | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment