diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-01-04 00:22:21 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-01-04 00:25:08 -0300 |
commit | 39374aa925a7d670b039c0c0c9aa9f4aef19466b (patch) | |
tree | 8e47fa7a1ec65c9729f50691cc3f65ffc91e493d /railties/test | |
parent | dd3360e05e4909f2f0c74a624cccc2def688f828 (diff) | |
download | rails-39374aa925a7d670b039c0c0c9aa9f4aef19466b.tar.gz rails-39374aa925a7d670b039c0c0c9aa9f4aef19466b.tar.bz2 rails-39374aa925a7d670b039c0c0c9aa9f4aef19466b.zip |
Set the default timezone after the initialization since the configuration
now lives in the application initializers.
Fix #8711
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/configuration_test.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index 53109cb041..920798c930 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -407,7 +407,17 @@ module ApplicationTests require "#{app_path}/config/environment" - assert_equal "Wellington", Rails.application.config.time_zone + assert_equal Time.find_zone!("Wellington"), Time.zone_default + end + + test "timezone can be set on initializers" do + app_file "config/initializers/locale.rb", <<-RUBY + Rails.application.config.time_zone = "Central Time (US & Canada)" + RUBY + + require "#{app_path}/config/environment" + + assert_equal Time.find_zone!("Central Time (US & Canada)"), Time.zone_default end test "raises when an invalid timezone is defined in the config" do |