From c70f52c4ddbad510885d3a29a6d476be5507875a Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Wed, 5 Oct 2016 12:14:56 -0400 Subject: [PATCH] remove some problem reports from the admin dashboard since they're covered by the setup wizard now --- app/models/admin_dashboard_data.rb | 35 +---------------- spec/models/admin_dashboard_data_spec.rb | 48 ------------------------ 2 files changed, 2 insertions(+), 81 deletions(-) diff --git a/app/models/admin_dashboard_data.rb b/app/models/admin_dashboard_data.rb index a8103aa7dec..bfcaff65fab 100644 --- a/app/models/admin_dashboard_data.rb +++ b/app/models/admin_dashboard_data.rb @@ -94,10 +94,8 @@ class AdminDashboardData :ram_check, :google_oauth2_config_check, :facebook_config_check, :twitter_config_check, :github_config_check, :s3_config_check, :image_magick_check, - :failing_emails_check, :default_logo_check, :contact_email_check, - :send_consumer_email_check, :title_check, - :site_description_check, :site_contact_username_check, - :notification_email_check, :subfolder_ends_in_slash_check, + :failing_emails_check, :send_consumer_email_check, + :subfolder_ends_in_slash_check, :pop3_polling_configuration, :email_polling_errored_recently add_problem_check do @@ -216,39 +214,10 @@ class AdminDashboardData I18n.t('dashboard.failing_emails_warning', num_failed_jobs: num_failed_jobs) if num_failed_jobs > 0 end - def default_logo_check - 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 - - def contact_email_check - return I18n.t('dashboard.contact_email_missing') if !SiteSetting.contact_email.present? - return I18n.t('dashboard.contact_email_invalid') if !(SiteSetting.contact_email =~ User::EMAIL) - end - - def title_check - I18n.t('dashboard.title_nag') if SiteSetting.title == SiteSetting.defaults[:title] - end - - def site_description_check - I18n.t('dashboard.site_description_missing') if !SiteSetting.site_description.present? - end - def send_consumer_email_check I18n.t('dashboard.consumer_email_warning') if Rails.env.production? and ActionMailer::Base.smtp_settings[:address] =~ /gmail\.com|live\.com|yahoo\.com/ end - def site_contact_username_check - I18n.t('dashboard.site_contact_username_warning') if !SiteSetting.site_contact_username.present? || SiteSetting.site_contact_username == SiteSetting.defaults[:site_contact_username] - end - - def notification_email_check - I18n.t('dashboard.notification_email_warning') if !SiteSetting.notification_email.present? || SiteSetting.notification_email == SiteSetting.defaults[:notification_email] - end - def subfolder_ends_in_slash_check I18n.t('dashboard.subfolder_ends_in_slash') if Discourse.base_uri =~ /\/$/ end diff --git a/spec/models/admin_dashboard_data_spec.rb b/spec/models/admin_dashboard_data_spec.rb index eae7f68079f..aa9f7080b30 100644 --- a/spec/models/admin_dashboard_data_spec.rb +++ b/spec/models/admin_dashboard_data_spec.rb @@ -146,54 +146,6 @@ describe AdminDashboardData do end end - describe 'default_logo_check' do - subject { described_class.new.default_logo_check } - - describe 'favicon_url check' do - before do - SiteSetting.logo_url = '/assets/my-logo.jpg' - SiteSetting.logo_small_url = '/assets/my-small-logo.jpg' - end - - it 'returns a string when favicon_url is default' do - expect(subject).not_to be_nil - end - - it 'returns a string when favicon_url contains default filename' do - SiteSetting.favicon_url = "/prefix#{SiteSetting.defaults[:favicon_url]}" - expect(subject).not_to be_nil - end - - it 'returns nil when favicon_url does not match default-favicon.png' do - SiteSetting.favicon_url = '/assets/my-favicon.png' - expect(subject).to be_nil - end - end - - describe 'logo_url check' do - before do - SiteSetting.favicon_url = '/assets/my-favicon.png' - SiteSetting.logo_small_url = '/assets/my-small-logo.jpg' - end - - it 'returns a string when logo_url is default' do - expect(subject).not_to be_nil - end - - it 'returns a string when logo_url contains default filename' do - SiteSetting.logo_url = "/prefix#{SiteSetting.defaults[:logo_url]}" - expect(subject).not_to be_nil - end - - it 'returns nil when logo_url does not match d-logo-sketch.png' do - SiteSetting.logo_url = '/assets/my-logo.png' - expect(subject).to be_nil - end - end - - # etc. - end - describe 'auth_config_checks' do shared_examples 'problem detection for login providers' do