summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-12-16 13:32:05 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-12-16 17:51:08 +0100
commitebc3f62be52e386b4550e01ce589744e880ad443 (patch)
tree718a7b680b679983e128e1df92a456e04a58e3e3
parentcc83aded33471a3e2f943bd9a760f689d30f901e (diff)
downloadgitlab-ce-ebc3f62be52e386b4550e01ce589744e880ad443.tar.gz
Fix specs
-rw-r--r--app/views/projects/services/mattermost_slash_commands/_help.html.haml5
-rw-r--r--lib/gitlab/chat_commands/command.rb4
-rw-r--r--lib/gitlab/chat_commands/presenter.rb11
3 files changed, 12 insertions, 8 deletions
diff --git a/app/views/projects/services/mattermost_slash_commands/_help.html.haml b/app/views/projects/services/mattermost_slash_commands/_help.html.haml
index 2bdd4cd148c..01a77a952d1 100644
--- a/app/views/projects/services/mattermost_slash_commands/_help.html.haml
+++ b/app/views/projects/services/mattermost_slash_commands/_help.html.haml
@@ -1,5 +1,4 @@
-- pretty_path_with_namespace = "#{@project.namespace ? @project.namespace.name : 'namespace'} / #{@project ? @project.name : 'name'}"
-- run_actions_text = "Perform common operations on this project: #{pretty_path_with_namespace}"
+- run_actions_text = "Perform common operations on this project: #{@project.name_with_namespace}"
.well
This service allows GitLab users to perform common operations on this
@@ -27,7 +26,7 @@
.form-group
= label_tag :display_name, 'Display name', class: 'col-sm-2 col-xs-12 control-label'
.col-sm-10.col-xs-12.input-group
- = text_field_tag :display_name, "GitLab / #{pretty_path_with_namespace}", class: 'form-control input-sm', readonly: 'readonly'
+ = text_field_tag :display_name, "GitLab / #{@project.name_with_namespace}", class: 'form-control input-sm', readonly: 'readonly'
.input-group-btn
= clipboard_button(clipboard_target: '#display_name')
diff --git a/lib/gitlab/chat_commands/command.rb b/lib/gitlab/chat_commands/command.rb
index c5c54cf7cfc..145086755e4 100644
--- a/lib/gitlab/chat_commands/command.rb
+++ b/lib/gitlab/chat_commands/command.rb
@@ -22,8 +22,6 @@ module Gitlab
end
end
- private
-
def match_command
match = nil
service = available_commands.find do |klass|
@@ -33,6 +31,8 @@ module Gitlab
[service, match]
end
+ private
+
def help_messages
available_commands.map(&:help_message)
end
diff --git a/lib/gitlab/chat_commands/presenter.rb b/lib/gitlab/chat_commands/presenter.rb
index e151513cbd5..c86efc0c3f8 100644
--- a/lib/gitlab/chat_commands/presenter.rb
+++ b/lib/gitlab/chat_commands/presenter.rb
@@ -135,9 +135,14 @@ module Gitlab
def link(url, title)
case format
- when 'slack' then "<#{url}|#{title}>"
- when 'mattermost' then "[#{title}](#{url})"
- else then title
+ when 'slack'
+ "<#{url}|#{title}>"
+
+ when 'mattermost'
+ "[#{title}](#{url})"
+
+ else
+ title
end
end
end