BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
07a88040
Commit
07a88040
authored
Apr 25, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix NotificationService spec
parent
682ec038
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
reference_filter.rb
lib/gitlab/markdown/reference_filter.rb
+3
-3
user_reference_filter.rb
lib/gitlab/markdown/user_reference_filter.rb
+2
-2
user_reference_filter_spec.rb
spec/lib/gitlab/markdown/user_reference_filter_spec.rb
+2
-2
No files found.
lib/gitlab/markdown/reference_filter.rb
View file @
07a88040
...
...
@@ -41,10 +41,10 @@ module Gitlab
#
# type - Singular Symbol reference type (e.g., :issue, :user, etc.)
# value - Object to add
def
push_result
(
type
,
value
)
return
if
value
.
nil
?
def
push_result
(
type
,
*
values
)
return
if
value
s
.
empty
?
result
[
:references
][
type
].
push
(
value
)
result
[
:references
][
type
].
push
(
*
values
)
end
def
reference_class
(
type
)
...
...
lib/gitlab/markdown/user_reference_filter.rb
View file @
07a88040
...
...
@@ -45,7 +45,7 @@ module Gitlab
if
user
==
'all'
# FIXME (rspeicher): Law of Demeter
push_result
(
:user
,
project
.
team
.
members
.
flatten
)
push_result
(
:user
,
*
project
.
team
.
members
.
flatten
)
url
=
link_to_all
(
project
)
...
...
@@ -53,7 +53,7 @@ module Gitlab
elsif
namespace
=
Namespace
.
find_by
(
path:
user
)
if
namespace
.
is_a?
(
Group
)
if
user_can_reference_group?
(
namespace
)
push_result
(
:user
,
namespace
.
users
)
push_result
(
:user
,
*
namespace
.
users
)
url
=
group_url
(
user
,
only_path:
context
[
:only_path
])
%(<a href="#{url}" class="#{klass}">@#{user}</a>)
...
...
spec/lib/gitlab/markdown/user_reference_filter_spec.rb
View file @
07a88040
...
...
@@ -38,7 +38,7 @@ module Gitlab::Markdown
it
'adds to the results hash'
do
result
=
pipeline_result
(
'Hey @all'
)
expect
(
result
[
:references
][
:user
]).
to
eq
[
[
project
.
creator
]
]
expect
(
result
[
:references
][
:user
]).
to
eq
[
project
.
creator
]
end
end
...
...
@@ -90,7 +90,7 @@ module Gitlab::Markdown
it
'adds to the results hash'
do
result
=
pipeline_result
(
"Hey
#{
reference
}
"
,
current_user:
user
)
expect
(
result
[
:references
][
:user
]).
to
eq
[
group
.
users
]
expect
(
result
[
:references
][
:user
]).
to
eq
group
.
users
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment