Skip to content

Commit

Permalink
Only include Turbo::Broadcastable::TestHelper with Action Cable
Browse files Browse the repository at this point in the history
Closes [#573][]
Related to [#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.

[#573]: #573
[#565]: #565 (comment)
  • Loading branch information
seanpdoyle committed Feb 9, 2024
1 parent 1ebc46c commit 8a0499d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/turbo/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,12 @@ class Engine < Rails::Engine
initializer "turbo.test_assertions" do
ActiveSupport.on_load(:active_support_test_case) do
require "turbo/test_assertions"
require "turbo/broadcastable/test_helper"

include Turbo::TestAssertions
include Turbo::Broadcastable::TestHelper

ActiveSupport.on_load(:action_cable) do
require "turbo/broadcastable/test_helper"
include Turbo::Broadcastable::TestHelper
end
end

ActiveSupport.on_load(:action_dispatch_integration_test) do
Expand Down

0 comments on commit 8a0499d

Please sign in to comment.