Created
December 4, 2011 02:03
-
-
Save joshsmith/1428863 to your computer and use it in GitHub Desktop.
First use of vows
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
♢ InterestModel | |
The InterestModel can get an interest by name | |
✓ should be named "28 Days Later" | |
✓ OK » 1 honored (0.006s) |
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
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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?