Is there a way to test when bot initiate a private message ?
ex:
//script
module.exports = (robot) ->
robot.hear /onboard (@.*)/, (res) ->
name = res.match[1]
res.send "Glad to see a new face! Onboarding #{name} right now"
res.sendPrivate name, "hey #{name} can you tell me your secret password ?"
//test
it 'initiate a private message to user', ->
@room.user.say('stephane', 'onboard @arthur 28/10').then =>
expect(@room.privateMessages).to.eql {
'arthur': [
['hubot', 'hey @arthur can you tell me your secret password ?']
]
}
Hey,
Is there a way to test when bot initiate a private message ? ex: