aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorJosh Kalderimis <josh.kalderimis@gmail.com>2011-04-05 00:33:29 +0200
committerSantiago Pastorino <santiago@wyeworks.com>2011-04-05 17:12:09 -0300
commite9020b4b5dbd4a19e288c613a86c78e32010c361 (patch)
tree21cfdc61c1db53243fafc69e0afeb06df5f1df62 /railties
parent1c4db4d7c34a1062e998bbdee03e992c4c5bff6d (diff)
downloadrails-e9020b4b5dbd4a19e288c613a86c78e32010c361.tar.gz
rails-e9020b4b5dbd4a19e288c613a86c78e32010c361.tar.bz2
rails-e9020b4b5dbd4a19e288c613a86c78e32010c361.zip
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 <santiago@wyeworks.com>
Diffstat (limited to 'railties')
-rw-r--r--railties/test/application/configuration_test.rb22
1 files changed, 22 insertions, 0 deletions
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