From ef4a624de2be9b5241fe97e6c286b4bfd992fcde Mon Sep 17 00:00:00 2001 From: matt swanson Date: Thu, 8 Feb 2024 05:44:08 -0500 Subject: [PATCH] Include broadcastable assertions automatically in ActiveSupport::TestCase (#565) * Include broadcastable assertions automatically in ActiveSupport::TestCase * Update README --- README.md | 2 +- lib/turbo/engine.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cb401cd2..c943988a 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,7 @@ The [`Turbo::TestAssertions`](./lib/turbo/test_assertions.rb) concern provides T The [`Turbo::TestAssertions::IntegrationTestAssertions`](./lib/turbo/test_assertions/integration_test_assertions.rb) are built on top of `Turbo::TestAssertions`, and add support for passing a `status:` keyword. They are automatically included in [`ActionDispatch::IntegrationTest`](https://edgeguides.rubyonrails.org/testing.html#integration-testing). -The [`Turbo::Broadcastable::TestHelper`](./lib/turbo/broadcastable/test_helper.rb) concern provides Action Cable-aware test helpers that assert that `` elements were or were not broadcast over Action Cable. They are not automatically included. To use them in your tests, make sure to `include Turbo::Broadcastable::TestHelper`. +The [`Turbo::Broadcastable::TestHelper`](./lib/turbo/broadcastable/test_helper.rb) concern provides Action Cable-aware test helpers that assert that `` elements were or were not broadcast over Action Cable. `Turbo::Broadcastable::TestHelper` is automatically included in [`ActiveSupport::TestCase`](https://edgeapi.rubyonrails.org/classes/ActiveSupport/TestCase.html). ## Development diff --git a/lib/turbo/engine.rb b/lib/turbo/engine.rb index 74c4cd79..dc7e0853 100644 --- a/lib/turbo/engine.rb +++ b/lib/turbo/engine.rb @@ -84,6 +84,7 @@ class Engine < Rails::Engine require "turbo/broadcastable/test_helper" include Turbo::TestAssertions + include Turbo::Broadcastable::TestHelper end ActiveSupport.on_load(:action_dispatch_integration_test) do