Make default_logo_check more smarter

This commit is contained in:
Neil Lalonde 2013-06-05 16:59:19 -04:00
parent 4e8ff74b99
commit f030d9b420
2 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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