Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
bf3b8d1c
Commit
bf3b8d1c
authored
Sep 30, 2016
by
Katarzyna Kobierska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test, add author attribute to all tests
parent
f5e43f07
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
CHANGELOG
CHANGELOG
+1
-0
lib/banzai/filter/user_reference_filter.rb
lib/banzai/filter/user_reference_filter.rb
+2
-2
spec/lib/banzai/filter/user_reference_filter_spec.rb
spec/lib/banzai/filter/user_reference_filter_spec.rb
+9
-0
No files found.
CHANGELOG
View file @
bf3b8d1c
...
@@ -35,6 +35,7 @@ v 8.13.0 (unreleased)
...
@@ -35,6 +35,7 @@ v 8.13.0 (unreleased)
- Optimize GitHub importing for speed and memory
- Optimize GitHub importing for speed and memory
- API: expose pipeline data in builds API (!6502, Guilherme Salazar)
- API: expose pipeline data in builds API (!6502, Guilherme Salazar)
- Notify the Merger about merge after successful build (Dimitris Karakasilis)
- Notify the Merger about merge after successful build (Dimitris Karakasilis)
- Prevent rendering the link to all when the author has no access (Katarzyna Kobierska Ula Budziszewska)
- Fix broken repository 500 errors in project list
- Fix broken repository 500 errors in project list
- Close todos when accepting merge requests via the API !6486 (tonygambone)
- Close todos when accepting merge requests via the API !6486 (tonygambone)
...
...
lib/banzai/filter/user_reference_filter.rb
View file @
bf3b8d1c
...
@@ -107,7 +107,7 @@ module Banzai
...
@@ -107,7 +107,7 @@ module Banzai
author
=
context
[
:author
]
author
=
context
[
:author
]
if
author
&&
!
project
.
team
.
member?
(
author
)
if
author
&&
!
project
.
team
.
member?
(
author
)
'@all'
link_text
else
else
url
=
urls
.
namespace_project_url
(
project
.
namespace
,
project
,
url
=
urls
.
namespace_project_url
(
project
.
namespace
,
project
,
only_path:
context
[
:only_path
])
only_path:
context
[
:only_path
])
...
...
spec/lib/banzai/filter/user_reference_filter_spec.rb
View file @
bf3b8d1c
...
@@ -31,13 +31,16 @@ describe Banzai::Filter::UserReferenceFilter, lib: true do
...
@@ -31,13 +31,16 @@ describe Banzai::Filter::UserReferenceFilter, lib: true do
end
end
it
'supports a special @all mention'
do
it
'supports a special @all mention'
do
project
.
team
<<
[
user
,
:developer
]
doc
=
reference_filter
(
"Hey
#{
reference
}
"
,
author:
user
)
doc
=
reference_filter
(
"Hey
#{
reference
}
"
,
author:
user
)
expect
(
doc
.
css
(
'a'
).
length
).
to
eq
1
expect
(
doc
.
css
(
'a'
).
length
).
to
eq
1
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'href'
))
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'href'
))
.
to
eq
urls
.
namespace_project_url
(
project
.
namespace
,
project
)
.
to
eq
urls
.
namespace_project_url
(
project
.
namespace
,
project
)
end
end
it
'includes a data-author attribute when there is an author'
do
it
'includes a data-author attribute when there is an author'
do
project
.
team
<<
[
user
,
:developer
]
doc
=
reference_filter
(
reference
,
author:
user
)
doc
=
reference_filter
(
reference
,
author:
user
)
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'data-author'
)).
to
eq
(
user
.
id
.
to_s
)
expect
(
doc
.
css
(
'a'
).
first
.
attr
(
'data-author'
)).
to
eq
(
user
.
id
.
to_s
)
...
@@ -48,6 +51,12 @@ describe Banzai::Filter::UserReferenceFilter, lib: true do
...
@@ -48,6 +51,12 @@ describe Banzai::Filter::UserReferenceFilter, lib: true do
expect
(
doc
.
css
(
'a'
).
first
.
has_attribute?
(
'data-author'
)).
to
eq
(
false
)
expect
(
doc
.
css
(
'a'
).
first
.
has_attribute?
(
'data-author'
)).
to
eq
(
false
)
end
end
it
'ignores reference to all when user is not a project member'
do
doc
=
reference_filter
(
"Hey
#{
reference
}
"
,
author:
user
)
expect
(
doc
.
css
(
'a'
).
length
).
to
eq
0
end
end
end
context
'mentioning a user'
do
context
'mentioning a user'
do
...
...
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