diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2016-11-18 11:38:54 +0100 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2016-11-18 11:38:54 +0100 |
commit | f749fb7fe0574d07eeb38561b9af62754e518281 (patch) | |
tree | e8647693e60b73f12cd3b9dca0efb0aec1796fcb /lib/mattermost | |
parent | b8607576c1bb25fe2cbb575b48becdf7bd4aaa8c (diff) | |
download | gitlab-ce-f749fb7fe0574d07eeb38561b9af62754e518281.tar.gz |
Improve style, add more tests
Diffstat (limited to 'lib/mattermost')
-rw-r--r-- | lib/mattermost/presenter.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/mattermost/presenter.rb b/lib/mattermost/presenter.rb index d7455d39bce..b4e7358770f 100644 --- a/lib/mattermost/presenter.rb +++ b/lib/mattermost/presenter.rb @@ -1,7 +1,7 @@ module Mattermost class Presenter class << self - include Rails.application.routes.url_helpers + include Gitlab::Routing.url_helpers def authorize_chat_name(url) message = if url @@ -14,7 +14,7 @@ module Mattermost end def help(commands, trigger) - if commands.count == 0 + if commands.empty? ephemeral_response("No commands configured") unless messages.count > 1 else message = header_with_list("Available commands", commands) @@ -50,7 +50,7 @@ module Mattermost end def single_resource(resource) - return error(resource) if resource.errors.any? + return error(resource) if resource.errors.any? || !resource.persisted? message = "### #{title(resource)}" message << "\n\n#{resource.description}" if resource.description |