Commit c72c76fd authored by Z.J. van de Weg's avatar Z.J. van de Weg

Fix typos

parent dd826a5f
...@@ -12,7 +12,7 @@ class MattermostCommandService < ChatService ...@@ -12,7 +12,7 @@ class MattermostCommandService < ChatService
end end
def description def description
'Mattermost is an open source, self-hosted Slack-alternative' "Perform common operations on GitLab in Mattermost"
end end
def to_param def to_param
......
...@@ -98,14 +98,14 @@ ActiveRecord::Schema.define(version: 20161113184239) do ...@@ -98,14 +98,14 @@ ActiveRecord::Schema.define(version: 20161113184239) do
t.text "help_page_text_html" t.text "help_page_text_html"
t.text "shared_runners_text_html" t.text "shared_runners_text_html"
t.text "after_sign_up_text_html" t.text "after_sign_up_text_html"
t.boolean "sidekiq_throttling_enabled", default: false
t.string "sidekiq_throttling_queues"
t.decimal "sidekiq_throttling_factor"
t.boolean "housekeeping_enabled", default: true, null: false t.boolean "housekeeping_enabled", default: true, null: false
t.boolean "housekeeping_bitmaps_enabled", default: true, null: false t.boolean "housekeeping_bitmaps_enabled", default: true, null: false
t.integer "housekeeping_incremental_repack_period", default: 10, null: false t.integer "housekeeping_incremental_repack_period", default: 10, null: false
t.integer "housekeeping_full_repack_period", default: 50, null: false t.integer "housekeeping_full_repack_period", default: 50, null: false
t.integer "housekeeping_gc_period", default: 200, null: false t.integer "housekeeping_gc_period", default: 200, null: false
t.boolean "sidekiq_throttling_enabled", default: false
t.string "sidekiq_throttling_queues"
t.decimal "sidekiq_throttling_factor"
end end
create_table "audit_events", force: :cascade do |t| create_table "audit_events", force: :cascade do |t|
...@@ -384,17 +384,6 @@ ActiveRecord::Schema.define(version: 20161113184239) do ...@@ -384,17 +384,6 @@ ActiveRecord::Schema.define(version: 20161113184239) do
add_index "ci_variables", ["gl_project_id"], name: "index_ci_variables_on_gl_project_id", using: :btree add_index "ci_variables", ["gl_project_id"], name: "index_ci_variables_on_gl_project_id", using: :btree
create_table "custom_emoji", force: :cascade do |t|
t.integer "project_id", null: false
t.string "name"
t.string "emoji"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
add_index "custom_emoji", ["project_id", "name"], name: "index_custom_emoji_on_project_id_and_name", unique: true, using: :btree
add_index "custom_emoji", ["project_id"], name: "index_custom_emoji_on_project_id", using: :btree
create_table "deploy_keys_projects", force: :cascade do |t| create_table "deploy_keys_projects", force: :cascade do |t|
t.integer "deploy_key_id", null: false t.integer "deploy_key_id", null: false
t.integer "project_id", null: false t.integer "project_id", null: false
...@@ -941,7 +930,7 @@ ActiveRecord::Schema.define(version: 20161113184239) do ...@@ -941,7 +930,7 @@ ActiveRecord::Schema.define(version: 20161113184239) do
t.boolean "has_external_wiki" t.boolean "has_external_wiki"
t.boolean "lfs_enabled" t.boolean "lfs_enabled"
t.text "description_html" t.text "description_html"
t.boolean "only_allow_merge_if_all_discussions_are_resolved", default: false, null: false t.boolean "only_allow_merge_if_all_discussions_are_resolved"
end end
add_index "projects", ["ci_id"], name: "index_projects_on_ci_id", using: :btree add_index "projects", ["ci_id"], name: "index_projects_on_ci_id", using: :btree
...@@ -1265,7 +1254,6 @@ ActiveRecord::Schema.define(version: 20161113184239) do ...@@ -1265,7 +1254,6 @@ ActiveRecord::Schema.define(version: 20161113184239) do
add_index "web_hooks", ["project_id"], name: "index_web_hooks_on_project_id", using: :btree add_index "web_hooks", ["project_id"], name: "index_web_hooks_on_project_id", using: :btree
add_foreign_key "boards", "projects" add_foreign_key "boards", "projects"
add_foreign_key "custom_emoji", "projects"
add_foreign_key "issue_metrics", "issues", on_delete: :cascade add_foreign_key "issue_metrics", "issues", on_delete: :cascade
add_foreign_key "label_priorities", "labels", on_delete: :cascade add_foreign_key "label_priorities", "labels", on_delete: :cascade
add_foreign_key "label_priorities", "projects", on_delete: :cascade add_foreign_key "label_priorities", "projects", on_delete: :cascade
......
...@@ -14,9 +14,10 @@ module Mattermost ...@@ -14,9 +14,10 @@ module Mattermost
end end
def help(commands, trigger) def help(commands, trigger)
if commands.zero? if commands.none?
ephemeral_response("No commands configured") ephemeral_response("No commands configured")
else else
commands.map! { |command| "#{trigger} #{command}" }
message = header_with_list("Available commands", commands) message = header_with_list("Available commands", commands)
ephemeral_response(message) ephemeral_response(message)
...@@ -46,7 +47,7 @@ module Mattermost ...@@ -46,7 +47,7 @@ module Mattermost
private private
def not_found def not_found
ephemeral_response("404 not found! GitLab couldn't find what your were looking for! :boom:") ephemeral_response("404 not found! GitLab couldn't find what you were looking for! :boom:")
end end
def single_resource(resource) def single_resource(resource)
...@@ -67,7 +68,7 @@ module Mattermost ...@@ -67,7 +68,7 @@ module Mattermost
end end
def error(resource) def error(resource)
message = header_with_list("The action was not succesful, because:", resource.errors.messages) message = header_with_list("The action was not successful, because:", resource.errors.messages)
ephemeral_response(message) ephemeral_response(message)
end end
......
...@@ -11,18 +11,19 @@ describe Gitlab::ChatCommands::Command, service: true do ...@@ -11,18 +11,19 @@ describe Gitlab::ChatCommands::Command, service: true do
let(:params) { { text: 'issue show 1' } } let(:params) { { text: 'issue show 1' } }
let(:project) { create(:project, has_external_issue_tracker: true) } let(:project) { create(:project, has_external_issue_tracker: true) }
it 'displays the help message' do it 'displays 404 messages' do
expect(subject[:response_type]).to be(:ephemeral) expect(subject[:response_type]).to be(:ephemeral)
expect(subject[:text]).to start_with('404 not found') expect(subject[:text]).to start_with('404 not found')
end end
end end
context 'when an unknown command is triggered' do context 'when an unknown command is triggered' do
let(:params) { { text: "unknown command 123" } } let(:params) { { command: '/gitlab', text: "unknown command 123" } }
it 'displays the help message' do it 'displays the help message' do
expect(subject[:response_type]).to be(:ephemeral) expect(subject[:response_type]).to be(:ephemeral)
expect(subject[:text]).to start_with('Available commands') expect(subject[:text]).to start_with('Available commands')
expect(subject[:text]).to match('/gitlab issue show')
end end
end end
...@@ -35,7 +36,7 @@ describe Gitlab::ChatCommands::Command, service: true do ...@@ -35,7 +36,7 @@ describe Gitlab::ChatCommands::Command, service: true do
end end
end end
context 'issue is succesfully created' do context 'issue is successfully created' do
let(:params) { { text: "issue create my new issue" } } let(:params) { { text: "issue create my new issue" } }
before do before do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment