Allow admins to configure instance favicon and logo (#30040)
This commit is contained in:
parent
b152f936c1
commit
bc24c4792d
9 changed files with 87 additions and 19 deletions
|
@ -285,4 +285,28 @@ describe ApplicationHelper do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#site_icon_path' do
|
||||
context 'when an icon exists' do
|
||||
let!(:favicon) { Fabricate(:site_upload, var: 'favicon') }
|
||||
|
||||
it 'returns the URL of the icon' do
|
||||
expect(helper.site_icon_path('favicon')).to eq(favicon.file.url('48'))
|
||||
end
|
||||
|
||||
it 'returns the URL of the icon with size parameter' do
|
||||
expect(helper.site_icon_path('favicon', 16)).to eq(favicon.file.url('16'))
|
||||
end
|
||||
end
|
||||
|
||||
context 'when an icon does not exist' do
|
||||
it 'returns nil' do
|
||||
expect(helper.site_icon_path('favicon')).to be_nil
|
||||
end
|
||||
|
||||
it 'returns nil with size parameter' do
|
||||
expect(helper.site_icon_path('favicon', 16)).to be_nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue