diff options
author | eileencodes <eileencodes@gmail.com> | 2017-02-21 11:02:39 -0500 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2017-02-21 11:15:58 -0500 |
commit | 1d8466c38804a555df58ebe214c9aa0e240ad856 (patch) | |
tree | 592d1c3ab8efd3ea3a3e937ceea73f7502258060 /railties/lib/rails | |
parent | 658b5244356feba2b262e87d8b333c5a46999a5d (diff) | |
download | rails-1d8466c38804a555df58ebe214c9aa0e240ad856.tar.gz rails-1d8466c38804a555df58ebe214c9aa0e240ad856.tar.bz2 rails-1d8466c38804a555df58ebe214c9aa0e240ad856.zip |
Only load SystemTestCase if Capybara is defined
For applications that are upgrading or applications that are choosing to
skip system testing Capbyara will not be available. SystemTestCase and
friends shoud only be loaded if Capbyara is defined.
Fixes #28094
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/test_help.rb | 15 |
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 |