Skip to content

Instantly share code, notes, and snippets.

@joshsmith
Created December 4, 2011 02:03
Show Gist options
  • Save joshsmith/1428863 to your computer and use it in GitHub Desktop.
Save joshsmith/1428863 to your computer and use it in GitHub Desktop.
First use of vows
♢ InterestModel
The InterestModel can get an interest by name
✓ should be named "28 Days Later"
✓ OK » 1 honored (0.006s)
var vows = require('vows')
, assert = require('assert')
, Interest = require('../models/interest');
var suite = vows.describe('InterestModel');
var interest = new Interest();
var app = require('../app');
suite.addBatch({
'The InterestModel': {
'can get an interest by name': {
topic: function() {
interest.getInterestByName('28 Days Later', this.callback);
},
'should be named "28 Days Later"': function (topic) {
assert.equal(topic.rows[0].name, "28 Days Later");
}
}
}
}).export(module);
@Raynos
Copy link

Raynos commented Dec 4, 2011

Raynos> joshsmith: your making a new Interest object outside a unit test
[2:04 AM] your not testing the construction of an interest model actually works
Raynos> also why do you require app? how are interest and app related?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment