Skip to content

Commit

Permalink
Include broadcastable assertions automatically in ActiveSupport::Test…
Browse files Browse the repository at this point in the history
…Case (#565)

* Include broadcastable assertions automatically in ActiveSupport::TestCase

* Update README
  • Loading branch information
swanson committed Feb 8, 2024
1 parent 1310379 commit ef4a624
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<turbo-stream>` 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 `<turbo-stream>` 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

Expand Down
1 change: 1 addition & 0 deletions lib/turbo/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ef4a624

Please sign in to comment.