diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-05-21 16:35:15 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-05-26 15:49:22 -0400 |
commit | 5a9c5520d9e63a38ed8b839be8430a5b5815da67 (patch) | |
tree | 9419a59b0eb796e77688871a19a8c20daf2809b5 /lib/gitlab | |
parent | 68f74aa82690ca83faf81654737f7d0caefdfbd3 (diff) | |
download | gitlab-ce-5a9c5520d9e63a38ed8b839be8430a5b5815da67.tar.gz |
Make use of to_reference in more specs
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/closing_issue_extractor.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/markdown/external_issue_reference_filter.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/markdown/issue_reference_filter.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/markdown/merge_request_reference_filter.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/markdown/snippet_reference_filter.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/markdown/user_reference_filter.rb | 9 |
6 files changed, 11 insertions, 8 deletions
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 %(<a href="#{url}" title="#{title}" - class="#{klass}">#{issue}</a>) + class="#{klass}">#{match}</a>) 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 %(<a href="#{url}" title="#{title}" - class="#{klass}">#{project_ref}##{id}</a>) + class="#{klass}">#{match}</a>) 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 %(<a href="#{url}" title="#{title}" - class="#{klass}">#{project_ref}!#{id}</a>) + class="#{klass}">#{match}</a>) 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 %(<a href="#{url}" title="#{title}" - class="#{klass}">#{project_ref}$#{id}</a>) + class="#{klass}">#{match}</a>) 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]) - %(<a href="#{url}" class="#{link_class}">@all</a>) + text = User.reference_prefix + 'all' + %(<a href="#{url}" class="#{link_class}">#{text}</a>) end def link_to_namespace(namespace) @@ -83,7 +84,8 @@ module Gitlab url = urls.group_url(group, only_path: context[:only_path]) - %(<a href="#{url}" class="#{link_class}">@#{group}</a>) + text = Group.reference_prefix + group + %(<a href="#{url}" class="#{link_class}">#{text}</a>) end def link_to_user(user, namespace) @@ -91,7 +93,8 @@ module Gitlab url = urls.user_url(user, only_path: context[:only_path]) - %(<a href="#{url}" class="#{link_class}">@#{user}</a>) + text = User.reference_prefix + user + %(<a href="#{url}" class="#{link_class}">#{text}</a>) end def user_can_reference_group?(group) |