backbone-generator/templates/collection_spec.coffee.erb

15 lines
357 B
Plaintext
Raw Normal View History

2011-05-09 02:44:21 +00:00
describe '<%= plural_object_name %>', ->
collection = null
withServer()
it 'should fetch records from the API', ->
2011-05-10 01:47:00 +00:00
collection = new <%= plural_object_name %>()
@server.respondWith('GET', '/<%= plural_underscore_name %>', @validJSONResponse([{id: 1}]))
collection.fetch()
@server.respond()
expect(collection.length).toEqual(1)
2011-05-09 02:44:21 +00:00