aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--railties/lib/rails/test_help.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/railties/lib/rails/test_help.rb b/railties/lib/rails/test_help.rb
index 75171f2395..09931c108a 100644
--- a/railties/lib/rails/test_help.rb
+++ b/railties/lib/rails/test_help.rb
@@ -7,11 +7,14 @@ require "active_support/test_case"
require "action_controller"
require "action_controller/test_case"
require "action_dispatch/testing/integration"
-require "action_dispatch/system_test_case"
require "rails/generators/test_case"
require "active_support/testing/autorun"
+if defined?(Capbyara)
+ require "action_dispatch/system_test_case"
+end
+
if defined?(ActiveRecord::Base)
ActiveRecord::Migration.maintain_test_schema!
@@ -46,9 +49,11 @@ class ActionDispatch::IntegrationTest
end
end
-class ActionDispatch::SystemTestCase
- def before_setup # :nodoc:
- @routes = Rails.application.routes
- super
+if defined? Capybara
+ class ActionDispatch::SystemTestCase
+ def before_setup # :nodoc:
+ @routes = Rails.application.routes
+ super
+ end
end
end