FEATURE: Allow plugins to add admin dashboard warnings

This commit is contained in:
Kane York
2015-08-25 17:07:40 -07:00
parent 01406c65a6
commit 3cbfc45bf6
2 changed files with 56 additions and 21 deletions

View File

@ -2,6 +2,32 @@ require 'spec_helper'
describe AdminDashboardData do
describe "adding new checks" do
it 'calls the passed block' do
called = false
AdminDashboardData.add_problem_check do
called = true
end
AdminDashboardData.fetch_problems
expect(called).to eq(true)
end
it 'calls the passed method' do
$test_AdminDashboardData_global = false
class AdminDashboardData
def my_test_method
$test_AdminDashboardData_global = true
end
end
AdminDashboardData.add_problem_check :my_test_method
AdminDashboardData.fetch_problems
expect($test_AdminDashboardData_global).to eq(true)
$test_AdminDashboardData_global = nil
end
end
describe "rails_env_check" do
subject { described_class.new.rails_env_check }