Skip to content

Instantly share code, notes, and snippets.

@dmitrig01
Created August 23, 2011 19:27
Show Gist options
  • Save dmitrig01/1166231 to your computer and use it in GitHub Desktop.
Save dmitrig01/1166231 to your computer and use it in GitHub Desktop.
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