Fix format of Slack when result is nil

This commit is contained in:
Z.J. van de Weg 2016-12-22 10:54:35 +01:00
parent 6d9c1d3efc
commit 4b7395e0fa
2 changed files with 3 additions and 2 deletions

View file

@ -16,7 +16,7 @@ class SlackSlashCommandsService < ChatSlashCommandsService
def trigger(params)
# Format messages to be Slack-compatible
super.tap do |result|
result[:text] = format(result[:text])
result[:text] = format(result[:text]) if result.is_a?(Hash)
end
end

View file

@ -18,7 +18,8 @@ describe SlackSlashCommandsService, :models do
let(:service) do
project.create_slack_slash_commands_service(
properties: { token: 'token' }
properties: { token: 'token' },
active: true
)
end