Skip to content

Instantly share code, notes, and snippets.

@dmachi
Created March 11, 2014 18:00
Show Gist options
  • Save dmachi/9491398 to your computer and use it in GitHub Desktop.
Save dmachi/9491398 to your computer and use it in GitHub Desktop.
define([
'intern!object',
'intern/chai!assert',
'intern/dojo/request',
'intern/dojo/node!../data-model',
'intern/dojo/promise/All'
], function (registerSuite, assert, request,dataModel,All) {
var suite = {
name: "Data Model Tests"
}
Object.keys(dataModel.DataModel).forEach(function(model) {
suite[model + "Query"] = function() {
var dfd = this.async(1000);
request('http://localhost:3002/' + model + '/&limit(10)',{headers:{accept:"application/json"},handleAs:"json"}).then(dfd.callback(function (data) {
assert.strictEqual(data.length, 10);
}, dfd.reject.bind(dfd)));
}
});
registerSuite(suite);
});
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment