Skip to content

Commit 3aed657

Browse files
committed
Fix autoload error on Rails 5
It seems that only Rails 3.x needs these lines for the specs to run.
1 parent a52dca9 commit 3aed657

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

example_app_generator/generate_action_mailer_specs.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def comment_lines(path, flag, *args)
2525
end
2626
end
2727
28-
if defined?(ActionMailer)
28+
if defined?(ActionMailer) && Rails::VERSION::MAJOR < 4
2929
# This will force the loading of ActionMailer settings
3030
ActionMailer::Base.smtp_settings
3131
end

example_app_generator/spec/support/default_preview_path

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ require_file_stub 'config/environment' do
3232
module ExampleApp
3333
class Application < Rails::Application
3434
config.eager_load = false
35-
config.eager_load_paths.clear
35+
config.eager_load_paths.clear if Rails::VERSION::MAJOR < 4
3636

3737
# Don't care if the mailer can't send.
3838
config.action_mailer.raise_delivery_errors = false unless ENV['NO_ACTION_MAILER']

0 commit comments

Comments
 (0)