aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2017-02-25 13:08:26 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2017-02-27 07:49:30 +0900
commita070dfa0c5b64084108977176b914ffb32ceac5f (patch)
treedaa5fe514ffe307fda0432d1c10348794e31ac6b /railties
parent87b2b6c5124732ff709b8e1900a99ba0a08f6982 (diff)
downloadrails-a070dfa0c5b64084108977176b914ffb32ceac5f.tar.gz
rails-a070dfa0c5b64084108977176b914ffb32ceac5f.tar.bz2
rails-a070dfa0c5b64084108977176b914ffb32ceac5f.zip
Only load SystemTestCase if Puma is defined
SystemTestCase supports only Puma, and always load puma's file. https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/system_testing/server.rb#L1 For that reason, the case of use Capybara but do not use Puma, it will cause an error. So we need to check about Puma is defined as well.
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/test_help.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/rails/test_help.rb b/railties/lib/rails/test_help.rb
index 09931c108a..8e290239bd 100644
--- a/railties/lib/rails/test_help.rb
+++ b/railties/lib/rails/test_help.rb
@@ -11,7 +11,7 @@ require "rails/generators/test_case"
require "active_support/testing/autorun"
-if defined?(Capbyara)
+if defined?(Capybara) && defined?(Puma)
require "action_dispatch/system_test_case"
end
@@ -49,7 +49,7 @@ class ActionDispatch::IntegrationTest
end
end
-if defined? Capybara
+if defined?(Capybara) && defined?(Puma)
class ActionDispatch::SystemTestCase
def before_setup # :nodoc:
@routes = Rails.application.routes