Created
March 21, 2011 05:42
-
-
Save nouse/879083 to your computer and use it in GitHub Desktop.
vows of zombie
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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