We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I've added a test harness to my production code that needs to be re-integrated into dispatch:
https://gist.github.com/1311173
It relies on the controllers.js lib file, which may also be reasonable to integrate into dispatch:
https://gist.github.com/1311177
It gets used together with sinon.js in a controller vows test like this:
var Asks = new ControlChain('asks'); function mockFindUser(user) { return function () { models.User.findById = function (id, callback) { callback(null, user); }; sinon.spy(models.User, 'findById'); }; } vows.describe('Ask Controller').addBatch({ 'my, user logged in' : { topic : Asks.get('my', { session : { currentUserId : '123456789abc' } }, { before : [ mockFindUser(mockObjects.user), mockFindAsks() ] }), 'finds user' : function (err, req, res) { assert.ok(models.User.findById.calledOnce); assert.equal(mockObjects.user.id, models.User.findById.getCall(0).args[0]); }, 'finds asks' : function (err, req, res) { assert.ok(models.Ask.find.calledOnce); }, 'should have status OK' : function (err, req, res) { assert.equal(res.statusCode, 200); }, 'should have correct return value' : function (err, req, res) { assert.deepEqual(mockObjects.asks, JSON.parse(res.body)); } } }).export(module);
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I've added a test harness to my production code that needs to be re-integrated into dispatch:
https://gist.github.com/1311173
It relies on the controllers.js lib file, which may also be reasonable to integrate into dispatch:
https://gist.github.com/1311177
It gets used together with sinon.js in a controller vows test like this:
The text was updated successfully, but these errors were encountered: