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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
daef4087
Commit
daef4087
authored
Jun 20, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix breadcrumb order
parent
bf0b3d83
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
app/helpers/groups_helper.rb
app/helpers/groups_helper.rb
+1
-1
spec/helpers/groups_helper_spec.rb
spec/helpers/groups_helper_spec.rb
+13
-0
No files found.
app/helpers/groups_helper.rb
View file @
daef4087
...
...
@@ -15,7 +15,7 @@ module GroupsHelper
@has_group_title
=
true
full_title
=
''
group
.
ancestors
.
each
do
|
parent
|
group
.
ancestors
.
reverse
.
each
do
|
parent
|
full_title
+=
link_to
(
simple_sanitize
(
parent
.
name
),
group_path
(
parent
),
class:
'group-path hidable'
)
full_title
+=
'<span class="hidable"> / </span>'
.
html_safe
end
...
...
spec/helpers/groups_helper_spec.rb
View file @
daef4087
require
'spec_helper'
describe
GroupsHelper
do
include
ApplicationHelper
describe
'group_icon'
do
avatar_file_path
=
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'banana_sample.gif'
)
...
...
@@ -81,4 +83,15 @@ describe GroupsHelper do
end
end
end
describe
'group_title'
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:nested_group
)
{
create
(
:group
,
parent:
group
)
}
let
(
:deep_nested_group
)
{
create
(
:group
,
parent:
nested_group
)
}
let!
(
:very_deep_nested_group
)
{
create
(
:group
,
parent:
deep_nested_group
)
}
it
'outputs the groups in the correct order'
do
expect
(
group_title
(
very_deep_nested_group
)).
to
match
(
/>
#{
group
.
name
}
<\/a>.*>
#{
nested_group
.
name
}
<\/a>.*>
#{
deep_nested_group
.
name
}
<\/a>/
)
end
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