diff options
author | Sam Granieri <sam@samgranieri.com> | 2008-07-24 13:51:54 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-07-24 13:51:54 -0500 |
commit | 11fdcf88c2aea72ec84c5d4ab05986f5d35a9a81 (patch) | |
tree | 16462af165a95e59164310eb673fecd5d13763bf /railties/test | |
parent | a87462afcb6c642e59bfcd2e11e3351e2b718c38 (diff) | |
download | rails-11fdcf88c2aea72ec84c5d4ab05986f5d35a9a81.tar.gz rails-11fdcf88c2aea72ec84c5d4ab05986f5d35a9a81.tar.bz2 rails-11fdcf88c2aea72ec84c5d4ab05986f5d35a9a81.zip |
Check for ActionMailer and ActionController before attempting to eager load their view paths
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/initializer_test.rb | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/railties/test/initializer_test.rb b/railties/test/initializer_test.rb index dee7abe05f..07303a510e 100644 --- a/railties/test/initializer_test.rb +++ b/railties/test/initializer_test.rb @@ -136,8 +136,27 @@ uses_mocha 'framework paths' do end end - protected + def test_action_mailer_load_paths_set_only_if_action_mailer_in_use + @config.frameworks = [:action_controller] + initializer = Rails::Initializer.new @config + initializer.send :require_frameworks + + assert_nothing_raised NameError do + initializer.send :load_view_paths + end + end + def test_action_controller_load_paths_set_only_if_action_controller_in_use + @config.frameworks = [] + initializer = Rails::Initializer.new @config + initializer.send :require_frameworks + + assert_nothing_raised NameError do + initializer.send :load_view_paths + end + end + + protected def assert_framework_path(path) assert @config.framework_paths.include?(path), "<#{path.inspect}> not found among <#{@config.framework_paths.inspect}>" |