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