From 5a9c5520d9e63a38ed8b839be8430a5b5815da67 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Thu, 21 May 2015 16:35:15 -0400 Subject: Make use of to_reference in more specs --- lib/gitlab/closing_issue_extractor.rb | 2 +- lib/gitlab/markdown/external_issue_reference_filter.rb | 2 +- lib/gitlab/markdown/issue_reference_filter.rb | 2 +- lib/gitlab/markdown/merge_request_reference_filter.rb | 2 +- lib/gitlab/markdown/snippet_reference_filter.rb | 2 +- lib/gitlab/markdown/user_reference_filter.rb | 9 ++++++--- 6 files changed, 11 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/gitlab/closing_issue_extractor.rb b/lib/gitlab/closing_issue_extractor.rb index ab184d95c05..aeec595782c 100644 --- a/lib/gitlab/closing_issue_extractor.rb +++ b/lib/gitlab/closing_issue_extractor.rb @@ -8,7 +8,7 @@ module Gitlab def closed_by_message(message) return [] if message.nil? - + closing_statements = message.scan(ISSUE_CLOSING_REGEX). map { |ref| ref[0] }.join(" ") diff --git a/lib/gitlab/markdown/external_issue_reference_filter.rb b/lib/gitlab/markdown/external_issue_reference_filter.rb index 2e74c6e45e2..afd28dd8cf3 100644 --- a/lib/gitlab/markdown/external_issue_reference_filter.rb +++ b/lib/gitlab/markdown/external_issue_reference_filter.rb @@ -48,7 +48,7 @@ module Gitlab %(#{issue}) + class="#{klass}">#{match}) end end diff --git a/lib/gitlab/markdown/issue_reference_filter.rb b/lib/gitlab/markdown/issue_reference_filter.rb index 2815626e247..dea04761ead 100644 --- a/lib/gitlab/markdown/issue_reference_filter.rb +++ b/lib/gitlab/markdown/issue_reference_filter.rb @@ -52,7 +52,7 @@ module Gitlab %(#{project_ref}##{id}) + class="#{klass}">#{match}) else match end diff --git a/lib/gitlab/markdown/merge_request_reference_filter.rb b/lib/gitlab/markdown/merge_request_reference_filter.rb index fddc050635f..80779819485 100644 --- a/lib/gitlab/markdown/merge_request_reference_filter.rb +++ b/lib/gitlab/markdown/merge_request_reference_filter.rb @@ -52,7 +52,7 @@ module Gitlab %(#{project_ref}!#{id}) + class="#{klass}">#{match}) else match end diff --git a/lib/gitlab/markdown/snippet_reference_filter.rb b/lib/gitlab/markdown/snippet_reference_filter.rb index f22f08de27c..174ba58af6c 100644 --- a/lib/gitlab/markdown/snippet_reference_filter.rb +++ b/lib/gitlab/markdown/snippet_reference_filter.rb @@ -52,7 +52,7 @@ module Gitlab %(#{project_ref}$#{id}) + class="#{klass}">#{match}) else match end diff --git a/lib/gitlab/markdown/user_reference_filter.rb b/lib/gitlab/markdown/user_reference_filter.rb index ca7fd7b0338..c9972957182 100644 --- a/lib/gitlab/markdown/user_reference_filter.rb +++ b/lib/gitlab/markdown/user_reference_filter.rb @@ -65,7 +65,8 @@ module Gitlab url = urls.namespace_project_url(project.namespace, project, only_path: context[:only_path]) - %(@all) + text = User.reference_prefix + 'all' + %(#{text}) end def link_to_namespace(namespace) @@ -83,7 +84,8 @@ module Gitlab url = urls.group_url(group, only_path: context[:only_path]) - %(@#{group}) + text = Group.reference_prefix + group + %(#{text}) end def link_to_user(user, namespace) @@ -91,7 +93,8 @@ module Gitlab url = urls.user_url(user, only_path: context[:only_path]) - %(@#{user}) + text = User.reference_prefix + user + %(#{text}) end def user_can_reference_group?(group) -- cgit v1.2.1