Make default_logo_check more smarter
This commit is contained in:
parent
4e8ff74b99
commit
f030d9b420
|
@ -106,9 +106,9 @@ class AdminDashboardData
|
|||
end
|
||||
|
||||
def default_logo_check
|
||||
if SiteSetting.logo_url =~ /d-logo-sketch\.png/ or
|
||||
SiteSetting.logo_small_url =~ /d-logo-sketch-small\.png/ or
|
||||
SiteSetting.favicon_url =~ /default-favicon\.png/
|
||||
if SiteSetting.logo_url =~ /#{SiteSetting.defaults[:logo_url].split('/').last}/ or
|
||||
SiteSetting.logo_small_url =~ /#{SiteSetting.defaults[:logo_small_url].split('/').last}/ or
|
||||
SiteSetting.favicon_url =~ /#{SiteSetting.defaults[:favicon_url].split('/').last}/
|
||||
I18n.t('dashboard.default_logo_warning')
|
||||
end
|
||||
end
|
||||
|
|
|
@ -157,8 +157,8 @@ describe AdminDashboardData do
|
|||
expect(subject).to_not be_nil
|
||||
end
|
||||
|
||||
it 'returns a string when favicon_url contains default-favicon.png' do
|
||||
SiteSetting.stubs(:favicon_url).returns('/discourse/images/default-favicon.png')
|
||||
it 'returns a string when favicon_url contains default filename' do
|
||||
SiteSetting.stubs(:favicon_url).returns("/prefix#{SiteSetting.defaults[:favicon_url]}")
|
||||
expect(subject).to_not be_nil
|
||||
end
|
||||
|
||||
|
@ -178,8 +178,8 @@ describe AdminDashboardData do
|
|||
expect(subject).to_not be_nil
|
||||
end
|
||||
|
||||
it 'returns a string when logo_url contains d-logo-sketch.png' do
|
||||
SiteSetting.stubs(:logo_url).returns('/discourse/images/d-logo-sketch.png')
|
||||
it 'returns a string when logo_url contains default filename' do
|
||||
SiteSetting.stubs(:logo_url).returns("/prefix#{SiteSetting.defaults[:logo_url]}")
|
||||
expect(subject).to_not be_nil
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue