var assert = require('assert') , tests , controller = geddy.controller.create('Users'); tests = { 'test user controller, add new user': function (next) { var user = User.create({username: 'hbinduni', password: 'MyPassword!', confirmPassword: 'MyPassword!', familyName: 'binduni', givenName: 'binduni', email: 'hbin...@email.com'}); //need to unit test controller.add here //how to mock req, resp? controller.add(req, resp, user); assert.equal(out, null); next(); } }; module.exports = tests;
how can i do unit test on controller method? how to mock request and response?
thank you.
--
The official community discussion group.
website: geddyjs.org, source: https://github.com/mde/geddy, group: https://groups.google.com/d/forum/geddyjs?hl=en
---
You received this message because you are subscribed to the Google Groups "GeddyJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geddyjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.