Skip to content

Commit a070dfa

Browse files
committed
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.
1 parent 87b2b6c commit a070dfa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

railties/lib/rails/test_help.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
require "active_support/testing/autorun"
1313

14-
if defined?(Capbyara)
14+
if defined?(Capybara) && defined?(Puma)
1515
require "action_dispatch/system_test_case"
1616
end
1717

@@ -49,7 +49,7 @@ def before_setup # :nodoc:
4949
end
5050
end
5151

52-
if defined? Capybara
52+
if defined?(Capybara) && defined?(Puma)
5353
class ActionDispatch::SystemTestCase
5454
def before_setup # :nodoc:
5555
@routes = Rails.application.routes

0 commit comments

Comments
 (0)