backbone-generator/templates/collection_spec.coffee.erb

15 lines
357 B
Plaintext

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