From f749fb7fe0574d07eeb38561b9af62754e518281 Mon Sep 17 00:00:00 2001 From: "Z.J. van de Weg" Date: Fri, 18 Nov 2016 11:38:54 +0100 Subject: Improve style, add more tests --- spec/lib/gitlab/chat_commands/command_spec.rb | 6 +++++- spec/lib/gitlab/chat_commands/issue_create_spec.rb | 2 +- spec/lib/gitlab/import_export/all_models.yml | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'spec/lib') diff --git a/spec/lib/gitlab/chat_commands/command_spec.rb b/spec/lib/gitlab/chat_commands/command_spec.rb index 11b607a6843..f44c848479e 100644 --- a/spec/lib/gitlab/chat_commands/command_spec.rb +++ b/spec/lib/gitlab/chat_commands/command_spec.rb @@ -7,7 +7,7 @@ describe Gitlab::ChatCommands::Command, service: true do subject { described_class.new(project, user, params).execute } describe '#execute' do - context 'when no command is not available' do + context 'when no command is available' do let(:params) { { text: 'issue show 1' } } let(:project) { create(:project, has_external_issue_tracker: true) } @@ -45,6 +45,10 @@ describe Gitlab::ChatCommands::Command, service: true do it 'presents the issue' do expect(subject[:text]).to match("my new issue") end + + it 'shows a link to the new issue' do + expect(subject[:text]).to match(/\/issues\/\d+/) + end end end end diff --git a/spec/lib/gitlab/chat_commands/issue_create_spec.rb b/spec/lib/gitlab/chat_commands/issue_create_spec.rb index 4831f24efed..df0c317ccea 100644 --- a/spec/lib/gitlab/chat_commands/issue_create_spec.rb +++ b/spec/lib/gitlab/chat_commands/issue_create_spec.rb @@ -34,7 +34,7 @@ describe Gitlab::ChatCommands::IssueCreate, service: true do end end - describe 'self.match' do + describe '.match' do it 'matches the title without description' do match = described_class.match("issue create my title") diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml index 02b11bd999a..bc837299b9e 100644 --- a/spec/lib/gitlab/import_export/all_models.yml +++ b/spec/lib/gitlab/import_export/all_models.yml @@ -116,6 +116,7 @@ project: - base_tags - tag_taggings - tags +- chat_services - creator - group - namespace @@ -127,6 +128,7 @@ project: - emails_on_push_service - builds_email_service - pipelines_email_service +- mattermost_command_service - irker_service - pivotaltracker_service - hipchat_service @@ -188,4 +190,4 @@ award_emoji: - awardable - user priorities: -- label \ No newline at end of file +- label -- cgit v1.2.3