Fix typos
This commit is contained in:
parent
dd826a5f20
commit
c72c76fde3
|
|
@ -12,7 +12,7 @@ class MattermostCommandService < ChatService
|
|||
end
|
||||
|
||||
def description
|
||||
'Mattermost is an open source, self-hosted Slack-alternative'
|
||||
"Perform common operations on GitLab in Mattermost"
|
||||
end
|
||||
|
||||
def to_param
|
||||
|
|
|
|||
20
db/schema.rb
20
db/schema.rb
|
|
@ -98,14 +98,14 @@ ActiveRecord::Schema.define(version: 20161113184239) do
|
|||
t.text "help_page_text_html"
|
||||
t.text "shared_runners_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_bitmaps_enabled", default: true, 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_gc_period", default: 200, null: false
|
||||
t.boolean "sidekiq_throttling_enabled", default: false
|
||||
t.string "sidekiq_throttling_queues"
|
||||
t.decimal "sidekiq_throttling_factor"
|
||||
end
|
||||
|
||||
create_table "audit_events", force: :cascade do |t|
|
||||
|
|
@ -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
|
||||
|
||||
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|
|
||||
t.integer "deploy_key_id", null: false
|
||||
t.integer "project_id", null: false
|
||||
|
|
@ -941,7 +930,7 @@ ActiveRecord::Schema.define(version: 20161113184239) do
|
|||
t.boolean "has_external_wiki"
|
||||
t.boolean "lfs_enabled"
|
||||
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
|
||||
|
||||
add_index "projects", ["ci_id"], name: "index_projects_on_ci_id", using: :btree
|
||||
|
|
@ -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_foreign_key "boards", "projects"
|
||||
add_foreign_key "custom_emoji", "projects"
|
||||
add_foreign_key "issue_metrics", "issues", on_delete: :cascade
|
||||
add_foreign_key "label_priorities", "labels", on_delete: :cascade
|
||||
add_foreign_key "label_priorities", "projects", on_delete: :cascade
|
||||
|
|
|
|||
|
|
@ -14,9 +14,10 @@ module Mattermost
|
|||
end
|
||||
|
||||
def help(commands, trigger)
|
||||
if commands.zero?
|
||||
if commands.none?
|
||||
ephemeral_response("No commands configured")
|
||||
else
|
||||
commands.map! { |command| "#{trigger} #{command}" }
|
||||
message = header_with_list("Available commands", commands)
|
||||
|
||||
ephemeral_response(message)
|
||||
|
|
@ -46,7 +47,7 @@ module Mattermost
|
|||
private
|
||||
|
||||
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
|
||||
|
||||
def single_resource(resource)
|
||||
|
|
@ -67,7 +68,7 @@ module Mattermost
|
|||
end
|
||||
|
||||
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)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -11,18 +11,19 @@ describe Gitlab::ChatCommands::Command, service: true do
|
|||
let(:params) { { text: 'issue show 1' } }
|
||||
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[:text]).to start_with('404 not found')
|
||||
end
|
||||
end
|
||||
|
||||
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
|
||||
expect(subject[:response_type]).to be(:ephemeral)
|
||||
expect(subject[:text]).to start_with('Available commands')
|
||||
expect(subject[:text]).to match('/gitlab issue show')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -35,7 +36,7 @@ describe Gitlab::ChatCommands::Command, service: true do
|
|||
end
|
||||
end
|
||||
|
||||
context 'issue is succesfully created' do
|
||||
context 'issue is successfully created' do
|
||||
let(:params) { { text: "issue create my new issue" } }
|
||||
|
||||
before do
|
||||
|
|
|
|||
Loading…
Reference in New Issue