Skip to content

Instantly share code, notes, and snippets.

@nouse
Created March 21, 2011 05:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nouse/879083 to your computer and use it in GitHub Desktop.
Save nouse/879083 to your computer and use it in GitHub Desktop.
vows of zombie
zombie = require("zombie")
assert = require("assert")
vows = require('vows')
vows.describe('vows of zombie').addBatch(
'when visit home page' :
topic : -> zombie.visit("http://localhost:3000", @callback)
'title should be correct' : (err, browser, status) ->
assert.equal(browser.text("title"), "Correct Title")
'follow link':
topic: (browser) ->
browser.clickLink 'About', @callback
'location should be correct' : (err, browser, status) ->
assert.equal browser.location, "http://localhost:3000/about"
'click event':
topic: (browser) ->
browser.clickLink 'change me', @callback
'click should change text' : (err, browser, status) ->
assert.equal browser.text('#to_change'), 'changed'
'link with ajax':
topic: (browser) ->
browser.clickLink 'ajaxify', @callback
'wait for ajax':
topic: (browser) ->
browser.wait @callback
'ajaxified' : (err, browser, status) ->
assert.equal browser.text('#ajax'), 'ajaxified'
).run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment