summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Geyer <debfx@fobos.de>2018-01-23 23:25:44 +0100
committerFelix Geyer <debfx@fobos.de>2018-01-28 17:39:22 +0100
commit94039bd7ca750446c637b924547493cfe8143716 (patch)
tree02c3cb6f7ef39419336065faba40f666690a11f5
parentdc325c672e20afa953117b0e1b04b2e399f391d7 (diff)
downloadgitlab-ce-94039bd7ca750446c637b924547493cfe8143716.tar.gz
Make default_avatar return a full path.
Callers expect a URL. This fixes the avatars in commit lists when a user has no avatar and Gravatar is disabled. Closes #38715
-rw-r--r--app/helpers/application_helper.rb2
-rw-r--r--spec/helpers/application_helper_spec.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index d13407a06c8..6530327698b 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -89,7 +89,7 @@ module ApplicationHelper
end
def default_avatar
- 'no_avatar.png'
+ asset_path('no_avatar.png')
end
def last_commit(project)
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb
index da0343588ef..f7a4a7afced 100644
--- a/spec/helpers/application_helper_spec.rb
+++ b/spec/helpers/application_helper_spec.rb
@@ -100,7 +100,7 @@ describe ApplicationHelper do
end
it 'returns a generic avatar' do
- expect(helper.gravatar_icon(user_email)).to match('no_avatar.png')
+ expect(helper.gravatar_icon(user_email)).to match_asset_path('no_avatar.png')
end
end
@@ -110,7 +110,7 @@ describe ApplicationHelper do
end
it 'returns a generic avatar when email is blank' do
- expect(helper.gravatar_icon('')).to match('no_avatar.png')
+ expect(helper.gravatar_icon('')).to match_asset_path('no_avatar.png')
end
it 'returns a valid Gravatar URL' do