Commit ac4cbf2e authored by Rémy Coutable's avatar Rémy Coutable

Fix Group#avatar_url spec

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 60b5db86
......@@ -194,14 +194,22 @@ describe Group, models: true do
end
context 'when in a geo secondary node' do
let(:geo_url) { 'http://geo.example.com' }
let(:geo_host) { 'http://geo.example.com' }
let(:geo_avatar_url) { [geo_host, avatar_path].join }
before do
allow(Gitlab::Geo).to receive(:secondary?) { true }
allow(Gitlab::Geo).to receive_message_chain(:primary_node, :url) { geo_url }
allow(Gitlab::Geo).to receive_message_chain(:primary_node, :url) { geo_host }
end
it { should eq "#{geo_url}#{avatar_path}" }
it 'shows correct avatar url' do
expect(group.avatar_url).to eq(geo_avatar_url)
expect(group.avatar_url(only_path: false)).to eq(geo_avatar_url)
allow(ActionController::Base).to receive(:asset_host).and_return(geo_host)
expect(group.avatar_url).to eq(geo_avatar_url)
end
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment