[#250,backend/ckan][s]: nicer way to do configuration of CKAN API endpoint including parsing of url - fixes #250.

This commit is contained in:
Rufus Pollock
2012-10-14 17:52:29 +01:00
parent 046ee8c1a0
commit 88dfa0b314
2 changed files with 54 additions and 4 deletions

View File

@@ -1,6 +1,17 @@
(function ($) {
module("Backend CKAN");
test('_parseCkanResourceUrl', function() {
var resid = 'eb23e809-ccbb-4ad1-820a-19586fc4bebd';
var url = 'http://demo.ckan.org/dataset/some-dataset/resource/' + resid;
var out = recline.Backend.Ckan._parseCkanResourceUrl(url);
var exp = {
resource_id: resid,
endpoint: 'http://demo.ckan.org/api'
}
deepEqual(out, exp);
});
test('_normalizeQuery', function() {
var dataset = new recline.Model.Dataset({
url: 'does-not-matter',