diff options
Diffstat (limited to 'railties/lib/initializer.rb')
-rw-r--r-- | railties/lib/initializer.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index c3ebffdf03..4a536e0483 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -615,7 +615,10 @@ module Rails end def default_load_paths - paths = ["#{root_path}/test/mocks/#{environment}"] + paths = [] + + # Add the old mock paths only if the directories exists + paths.concat(Dir["#{root_path}/test/mocks/#{environment}"]) if File.exists?("#{root_path}/test/mocks/#{environment}") # Add the app's controller directory paths.concat(Dir["#{root_path}/app/controllers/"]) |