diff options
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/configuration_test.rb | 9 | ||||
-rw-r--r-- | railties/test/railties/railtie_test.rb | 11 |
2 files changed, 20 insertions, 0 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index 97d5f64708..8bf0f09d6b 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -184,6 +184,15 @@ module ApplicationTests end end + test "config.paths.public sets Rails.public_path" do + add_to_config <<-RUBY + config.paths.public = "somewhere" + RUBY + + require "#{app_path}/config/application" + assert_equal File.join(app_path, "somewhere"), Rails.public_path + end + def make_basic_app require "rails" require "action_controller/railtie" diff --git a/railties/test/railties/railtie_test.rb b/railties/test/railties/railtie_test.rb index 546bf5e143..2accaca855 100644 --- a/railties/test/railties/railtie_test.rb +++ b/railties/test/railties/railtie_test.rb @@ -125,5 +125,16 @@ module RailtiesTest require "#{app_path}/config/environment" assert $ran_block end + + test "we can change our environment if we want to" do + begin + original_env = Rails.env + Rails.env = 'foo' + assert_equal('foo', Rails.env) + ensure + Rails.env = original_env + assert_equal(original_env, Rails.env) + end + end end end |