diff options
author | Achilleas Pipinellis <axilleas@axilleas.me> | 2017-05-10 18:57:19 +0000 |
---|---|---|
committer | Achilleas Pipinellis <axilleas@axilleas.me> | 2017-05-10 18:57:19 +0000 |
commit | 9c7d87ef0ec941b389cb5ef57a07ff0f43909305 (patch) | |
tree | 827aaf4dbb628eb31517aaf2960814a521430229 /spec/models/project_spec.rb | |
parent | 1e0df21a74017deb780023ed83f04dbbeed13899 (diff) | |
parent | 180ec7113e358a7f8388e1436dc0670a11ba68df (diff) | |
download | gitlab-ce-docs/hide-gcp-install.tar.gz |
Merge branch 'master' into 'docs/hide-gcp-install'docs/hide-gcp-install
# Conflicts:
# doc/install/README.md
Diffstat (limited to 'spec/models/project_spec.rb')
-rw-r--r-- | spec/models/project_spec.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 429b3dd83af..28aa44d8458 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -813,8 +813,16 @@ describe Project, models: true do context 'when avatar file is uploaded' do let(:project) { create(:empty_project, :with_avatar) } let(:avatar_path) { "/uploads/project/avatar/#{project.id}/dk.png" } + let(:gitlab_host) { "http://#{Gitlab.config.gitlab.host}" } - it { should eq "http://#{Gitlab.config.gitlab.host}#{avatar_path}" } + it 'shows correct url' do + expect(project.avatar_url).to eq(avatar_path) + expect(project.avatar_url(only_path: false)).to eq([gitlab_host, avatar_path].join) + + allow(ActionController::Base).to receive(:asset_host).and_return(gitlab_host) + + expect(project.avatar_url).to eq([gitlab_host, avatar_path].join) + end end context 'When avatar file in git' do |