aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/isolation/abstract_unit.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test/isolation/abstract_unit.rb')
-rw-r--r--railties/test/isolation/abstract_unit.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb
index 6071cd3f39..07a7faa3af 100644
--- a/railties/test/isolation/abstract_unit.rb
+++ b/railties/test/isolation/abstract_unit.rb
@@ -8,11 +8,10 @@
# Rails booted up.
require 'fileutils'
-require 'bundler/setup'
+require 'bundler/setup' unless defined?(Bundler)
require 'minitest/autorun'
require 'active_support/test_case'
-# TODO: Remove setting this magic constant
RAILS_FRAMEWORK_ROOT = File.expand_path("#{File.dirname(__FILE__)}/../../..")
# These files do not require any others and are needed
@@ -106,8 +105,9 @@ module TestHelpers
end
end
- unless options[:gemfile]
- File.delete"#{app_path}/Gemfile"
+ gemfile_path = "#{app_path}/Gemfile"
+ if options[:gemfile].blank? && File.exist?(gemfile_path)
+ File.delete gemfile_path
end
routes = File.read("#{app_path}/config/routes.rb")
@@ -118,6 +118,7 @@ module TestHelpers
end
add_to_config <<-RUBY
+ config.eager_load = false
config.secret_token = "3b7cd727ee24e8444053437c36cc66c4"
config.session_store :cookie_store, :key => "_myapp_session"
config.active_support.deprecation = :log
@@ -136,6 +137,7 @@ module TestHelpers
require "action_controller/railtie"
app = Class.new(Rails::Application)
+ app.config.eager_load = false
app.config.secret_token = "3b7cd727ee24e8444053437c36cc66c4"
app.config.session_store :cookie_store, :key => "_myapp_session"
app.config.active_support.deprecation = :log
@@ -253,7 +255,6 @@ module TestHelpers
:activerecord] - arr
if to_remove.include? :activerecord
remove_from_config "config.active_record.whitelist_attributes = true"
- remove_from_config "config.active_record.dependent_restrict_raises = false"
end
$:.reject! {|path| path =~ %r'/(#{to_remove.join('|')})/' }
end
@@ -281,8 +282,7 @@ Module.new do
environment = File.expand_path('../../../../load_paths', __FILE__)
require_environment = "-r #{environment}"
- `#{Gem.ruby} #{require_environment} #{RAILS_FRAMEWORK_ROOT}/railties/bin/rails new #{app_template_path}`
-
+ `#{Gem.ruby} #{require_environment} #{RAILS_FRAMEWORK_ROOT}/railties/bin/rails new #{app_template_path} --skip-gemfile`
File.open("#{app_template_path}/config/boot.rb", 'w') do |f|
f.puts "require '#{environment}'"
f.puts "require 'rails/all'"