mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FEATURE: Display force_https warning in admin problems dashboard
This commit is contained in:
@ -15,6 +15,9 @@ describe AdminDashboardData do
|
||||
|
||||
AdminDashboardData.fetch_problems
|
||||
expect(called).to eq(true)
|
||||
|
||||
AdminDashboardData.fetch_problems(check_force_https: true)
|
||||
expect(called).to eq(true)
|
||||
end
|
||||
|
||||
it 'calls the passed method' do
|
||||
@ -281,6 +284,32 @@ describe AdminDashboardData do
|
||||
end
|
||||
end
|
||||
|
||||
describe 'force_https_check' do
|
||||
subject { described_class.new(check_force_https: true).force_https_check }
|
||||
|
||||
it 'returns nil if force_https site setting enabled' do
|
||||
SiteSetting.force_https = true
|
||||
expect(subject).to be_nil
|
||||
end
|
||||
|
||||
it 'returns nil if force_https site setting not enabled' do
|
||||
SiteSetting.force_https = false
|
||||
expect(subject).to eq(I18n.t('dashboard.force_https_warning'))
|
||||
end
|
||||
end
|
||||
|
||||
describe 'ignore force_https_check' do
|
||||
subject { described_class.new(check_force_https: false).force_https_check }
|
||||
|
||||
it 'returns nil' do
|
||||
SiteSetting.force_https = true
|
||||
expect(subject).to be_nil
|
||||
|
||||
SiteSetting.force_https = false
|
||||
expect(subject).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
describe 'stats cache' do
|
||||
include_examples 'stats cachable'
|
||||
end
|
||||
|
Reference in New Issue
Block a user