backbone-generator/templates/collection_spec.js.erb

17 lines
402 B
Plaintext

describe('<%= plural_object_name %>', function() {
var collection;
withServer();
it('should fetch records from the API', function() {
collection = new <%= plural_object_name %>();
this.server.respondWith('GET', '/<%= plural_underscore_name %>', this.validJSONResponse([{id: 1}]));
collection.fetch()
this.server.respond();
expect(collection.length).toEqual(1);
});
});