Skip to content

Instantly share code, notes, and snippets.

@cpsubrian
Created August 1, 2011 02:21
Show Gist options
  • Save cpsubrian/1117472 to your computer and use it in GitHub Desktop.
Save cpsubrian/1117472 to your computer and use it in GitHub Desktop.
Testing FC
♢ FreedomConnector
An unauthenticated visit to the front page
✓ should have a status of 200
✓ should have an active logo anchor
✓ OK » 2 honored (1.087s)
/**
* Tests for FreedomConnector.
*/
process.env['NODE_ENV'] = 'test';
var vows = require('vows'),
tobi = require('tobi'),
should = require('should');
/**
* Macros
*/
var getUrl = function(url) {
return function() {
var browser = tobi.createBrowser(80, 'connect.freedomworks.org');
browser.get(url, this.callback.bind(this, null));
}
}
/**
* Tests
*/
vows.describe('FreedomConnector').addBatch({
'An unauthenticated visit to the front page': {
topic: getUrl('/'),
'should have a status of 200': function(_, res, $){
res.should.have.status(200);
},
'should have an active logo anchor': function(_, res, $) {
$('div.logo').should.have.one('a.active');
},
}
}).export(module);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment