Skip to content

Commit 07d3488

Browse files
authored
Only include Turbo::Broadcastable::TestHelper with Action Cable (hotwired#574)
Closes [hotwired#573][] Related to [hotwired#565][] Re-structure the automatic inclusion of the `Turbo::Broadcastable::TestHelper` module so that it's only automatically loaded and installed when Action Cable is available to the runtime. [hotwired#573]: hotwired#573 [hotwired#565]: hotwired#565 (comment)
1 parent 1ebc46c commit 07d3488

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/turbo/engine.rb

+7-3
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,14 @@ class Engine < Rails::Engine
8181
initializer "turbo.test_assertions" do
8282
ActiveSupport.on_load(:active_support_test_case) do
8383
require "turbo/test_assertions"
84-
require "turbo/broadcastable/test_helper"
85-
8684
include Turbo::TestAssertions
87-
include Turbo::Broadcastable::TestHelper
85+
end
86+
87+
ActiveSupport.on_load(:action_cable) do
88+
ActiveSupport.on_load(:active_support_test_case) do
89+
require "turbo/broadcastable/test_helper"
90+
include Turbo::Broadcastable::TestHelper
91+
end
8892
end
8993

9094
ActiveSupport.on_load(:action_dispatch_integration_test) do

0 commit comments

Comments
 (0)