-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
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
Add groups
function to user object
#20
base: master
Are you sure you want to change the base?
Add groups
function to user object
#20
Conversation
Tests I believe were previously broken. |
Looks good to me. Do we have an owner for hubot-auth? |
Cool, thanks! Yep, I still have merge perms. Have you been actively running this code? Also, will it need updated version constraints in package.json, ie for the earliest hubot version it will work with? |
Yeah, I've been running this code with our hubot instance at work for a few days. It uses |
4bf5e17
to
1a5cfaa
Compare
Thanks! Rats... mock-adaptor doesn't seem to work against that version of hubot. Haven't been using hubot lately -- any suggestions on the current best-practice for hubot testing? |
robot.listenerMiddleware (context, next, done) -> | ||
context.response.message.user.groups = (cb) -> | ||
cb(robot.auth.userRoles(context.response.message.user)) | ||
next() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This requires at least v2.15.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Updated package.json
to require "^2.15.0"
.
Useful so that hubot-auth can be used with [hubot-approval](https://github.com/michaelansel/hubot-approval) Updated `package.json` so that required hubot version goes from ^2.7.5 to ^2.15.0
1a5cfaa
to
97871ff
Compare
@michaelansel: Do you have recommendations for how @patcon can fix the tests? It looks like https://github.com/michaelansel/hubot-approval/blob/master/test/approval-test.coffee is using a combination of |
Yup, it's an open issue on the core. Up to @patcon to decide how to handle failing tests for his project. For more conversation on testing patterns, take a look at the open issue on the core: hubotio/hubot#985 |
Useful so that hubot-auth can be used with hubot-approval
Cc: @michaelansel