Commit 8967fc04 authored by Alexis Reigel's avatar Alexis Reigel

use custom main favicon

parent 40d8d7df
......@@ -33,4 +33,8 @@ module AppearancesHelper
render 'shared/logo_type.svg'
end
end
def brand_favicon
brand_item&.favicon
end
end
......@@ -39,6 +39,7 @@ module PageLayoutHelper
end
def favicon
return brand_favicon.default.url if brand_favicon
return 'favicon-yellow.ico' if Gitlab::Utils.to_boolean(ENV['CANARY'])
return 'favicon-blue.ico' if Rails.env.development?
......
......@@ -55,6 +55,11 @@ describe PageLayoutHelper do
stub_env('CANARY', 'true')
expect(helper.favicon).to eq 'favicon-yellow.ico'
end
it 'uses the custom favicon if an favicon appearance is present' do
create :appearance, favicon: fixture_file_upload(Rails.root.join('spec/fixtures/dk.png'))
expect(helper.favicon).to match %r{/uploads/-/system/appearance/favicon/\d+/default_dk.ico}
end
end
describe 'page_image' do
......
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