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
c1d23541
Commit
c1d23541
authored
Jan 06, 2017
by
hogewest
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken url on group avatar
parent
cd85baf5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
1 deletion
+37
-1
app/services/projects/participants_service.rb
app/services/projects/participants_service.rb
+1
-1
changelogs/unreleased/fix-broken-url-on-group-avatar.yml
changelogs/unreleased/fix-broken-url-on-group-avatar.yml
+4
-0
spec/services/projects/participants_service_spec.rb
spec/services/projects/participants_service_spec.rb
+32
-0
No files found.
app/services/projects/participants_service.rb
View file @
c1d23541
...
...
@@ -36,7 +36,7 @@ module Projects
def
groups
current_user
.
authorized_groups
.
sort_by
(
&
:path
).
map
do
|
group
|
count
=
group
.
users
.
count
{
username:
group
.
path
,
name:
group
.
name
,
count:
count
,
avatar_url:
group
.
avatar
.
url
}
{
username:
group
.
path
,
name:
group
.
name
,
count:
count
,
avatar_url:
group
.
avatar
_
url
}
end
end
...
...
changelogs/unreleased/fix-broken-url-on-group-avatar.yml
0 → 100644
View file @
c1d23541
---
title
:
Fix broken url on group avatar
merge_request
:
8464
author
:
hogewest
spec/services/projects/participants_service_spec.rb
0 → 100644
View file @
c1d23541
require
'spec_helper'
describe
Projects
::
ParticipantsService
,
services:
true
do
describe
'#groups'
do
describe
'avatar_url'
do
let
(
:project
)
{
create
(
:empty_project
,
:public
)
}
let
(
:group
)
{
create
(
:group
,
avatar:
fixture_file_upload
(
Rails
.
root
+
'spec/fixtures/dk.png'
))
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:base_url
)
{
Settings
.
send
(
:build_base_gitlab_url
)
}
let!
(
:group_member
)
{
create
(
:group_member
,
group:
group
,
user:
user
)
}
it
'should return an url for the avatar'
do
participants
=
described_class
.
new
(
project
,
user
)
groups
=
participants
.
groups
expect
(
groups
.
size
).
to
eq
1
expect
(
groups
.
first
[
:avatar_url
]).
to
eq
"
#{
base_url
}
/uploads/group/avatar/
#{
group
.
id
}
/dk.png"
end
it
'should return an url for the avatar with relative url'
do
stub_config_setting
(
relative_url_root:
'/gitlab'
)
stub_config_setting
(
url:
Settings
.
send
(
:build_gitlab_url
))
participants
=
described_class
.
new
(
project
,
user
)
groups
=
participants
.
groups
expect
(
groups
.
size
).
to
eq
1
expect
(
groups
.
first
[
:avatar_url
]).
to
eq
"
#{
base_url
}
/gitlab/uploads/group/avatar/
#{
group
.
id
}
/dk.png"
end
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