diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-11-09 15:40:41 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-11-09 15:40:41 +0000 |
commit | 2fbbba9a2958d51f9a6d8e0a7c4e06ec95ae18c0 (patch) | |
tree | 7db653ce366b6d2e96997675dc7911e5dabb0bec /spec/models/user_spec.rb | |
parent | 9a56496d4441569001d11572d74822ea0cb3e7eb (diff) | |
download | gitlab-ce-2fbbba9a2958d51f9a6d8e0a7c4e06ec95ae18c0.tar.gz |
Always return full avatar URL for private/internal groups/projects when asset host is set
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r-- | spec/models/user_spec.rb | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index a3ebf649aa8..65dccf9638d 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1149,16 +1149,9 @@ describe User do let(:user) { create(:user, :with_avatar) } context 'when avatar file is uploaded' do - let(:gitlab_host) { "http://#{Gitlab.config.gitlab.host}" } - let(:avatar_path) { "/uploads/-/system/user/avatar/#{user.id}/dk.png" } - it 'shows correct avatar url' do - expect(user.avatar_url).to eq(avatar_path) - expect(user.avatar_url(only_path: false)).to eq([gitlab_host, avatar_path].join) - - allow(ActionController::Base).to receive(:asset_host).and_return(gitlab_host) - - expect(user.avatar_url).to eq([gitlab_host, avatar_path].join) + expect(user.avatar_url).to eq(user.avatar.url) + expect(user.avatar_url(only_path: false)).to eq([Gitlab.config.gitlab.url, user.avatar.url].join) end end end |