[backend/gdocs][s]: support being given standard 'user' gdocs url by extracting spreadsheet key and generating url with it.

* This makes gdocs backend much easier to use!
This commit is contained in:
Rufus Pollock
2012-03-15 00:24:21 +00:00
parent 5660c88020
commit dd4fbeceb5
2 changed files with 32 additions and 1 deletions

View File

@@ -504,4 +504,15 @@ test("GDoc Backend", function() {
$.getJSON.restore();
});
test("GDoc Backend.getUrl", function() {
var key = 'Abc_dajkdkjdafkj';
var dataset = new recline.Model.Dataset({
url: 'https://docs.google.com/spreadsheet/ccc?key=' + key + '#gid=0'
});
var backend = recline.Model.backends['gdocs'];
var out = backend.getUrl(dataset);
var exp = 'https://spreadsheets.google.com/feeds/list/' + key + '/1/public/values?alt=json'
equal(exp, out);
});
})(this.jQuery);