mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
Start detecting install problems and report them on the admin dashboard. This commit adds check for Rails.env
This commit is contained in:
24
spec/models/admin_dashboard_data_spec.rb
Normal file
24
spec/models/admin_dashboard_data_spec.rb
Normal file
@ -0,0 +1,24 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe AdminDashboardData do
|
||||
|
||||
describe "rails_env_check" do
|
||||
subject { AdminDashboardData.new.rails_env_check }
|
||||
|
||||
it 'returns nil when running in production mode' do
|
||||
Rails.stubs(:env).returns('production')
|
||||
subject.should be_nil
|
||||
end
|
||||
|
||||
it 'returns a string when running in development mode' do
|
||||
Rails.stubs(:env).returns('development')
|
||||
subject.should_not be_nil
|
||||
end
|
||||
|
||||
it 'returns a string when running in test mode' do
|
||||
Rails.stubs(:env).returns('test')
|
||||
subject.should_not be_nil
|
||||
end
|
||||
end
|
||||
|
||||
end
|
Reference in New Issue
Block a user