Find file
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (23 sloc) 910 Bytes
A simple example Backbone.js test. Inspired by the following Stack Overflow
assert = require 'assert'
vows = require 'vows'
zombie = require 'zombie'
site = ''
vows.describe('Testing the Backbone.js Todos app')
'when first visiting the site':
topic: ->
browser = new zombie(debug: true, site: site)
browser.on 'error', (error) -> console.log error.stack
browser.visit '', @callback
'we should see an empty todo list': (error, browser, status) ->
html = browser.html('#todo-list')
expected = '<ul id="todo-list"></ul>'
assert.equal html, expected
'jQuery should be global function': (error, browser, status) ->
jquery = browser.evaluate('jQuery instanceof Function')
assert.ok jquery