From e9020b4b5dbd4a19e288c613a86c78e32010c361 Mon Sep 17 00:00:00 2001 From: Josh Kalderimis Date: Tue, 5 Apr 2011 00:33:29 +0200 Subject: added find_zone and find_zone! to AS timezones and changed the AS Railtie to use find_zone! as well as adding Railtie tests Signed-off-by: Santiago Pastorino --- railties/test/application/configuration_test.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'railties') diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index ce530b4b77..62697b1bf9 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -310,6 +310,28 @@ module ApplicationTests assert_equal [::MyMailObserver, ::MyOtherMailObserver], ::Mail.send(:class_variable_get, "@@delivery_notification_observers") end + test "valid timezone is setup correctly" do + add_to_config <<-RUBY + config.root = "#{app_path}" + config.time_zone = "Wellington" + RUBY + + require "#{app_path}/config/environment" + + assert_equal "Wellington", Rails.application.config.time_zone + end + + test "raises when an invalid timezone is defined in the config" do + add_to_config <<-RUBY + config.root = "#{app_path}" + config.time_zone = "That big hill over yonder hill" + RUBY + + assert_raise(ArgumentError) do + require "#{app_path}/config/environment" + end + end + test "config.action_controller.perform_caching = false" do make_basic_app do |app| app.config.action_controller.perform_caching = false -- cgit v1.2.3