You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Turbo in in Rails 7+, we're commonly broadcasting updates using the [Broadcastable](https://github.com/hotwired/turbo-rails/blob/main/app/models/concerns/turbo/broadcastable.rb) functionality. In most of our unit tests, those broadcasts are not really required and I would like to have a way to disable broadcasts temporarily when using FactoryBot.create.
Turbo/Broadcast does provide a convenience method to disable broadcasts via:
suppressing_turbo_broadcastsdo
...
end
So I ended up wrapping this around my create() calls. This doesn't seem to be the right approach, so I was wondering if there are plans to support this out-of-the-box eventually, or if should establish my own strategy to enable this? Eager to hear what would be the best way to have something like:
create(:my_factory)# with broadcastcreate_without_broadcast(:my_factory)
Just for reference, a monkey patch like this does work as intended - just wondering if this is right way to go about it.
Problem this feature will solve
Using Turbo in in Rails 7+, we're commonly broadcasting updates using the
[Broadcastable](https://github.com/hotwired/turbo-rails/blob/main/app/models/concerns/turbo/broadcastable.rb)
functionality. In most of our unit tests, those broadcasts are not really required and I would like to have a way to disable broadcasts temporarily when usingFactoryBot.create
.Turbo/Broadcast does provide a convenience method to disable broadcasts via:
So I ended up wrapping this around my
create()
calls. This doesn't seem to be the right approach, so I was wondering if there are plans to support this out-of-the-box eventually, or if should establish my own strategy to enable this? Eager to hear what would be the best way to have something like:Just for reference, a monkey patch like this does work as intended - just wondering if this is right way to go about it.
The text was updated successfully, but these errors were encountered: