# Returning turbo\_frame and broadcasting is a legit way to speed up performance?

**URL:** <https://discuss.hotwired.dev/t/returning-turbo-frame-and-broadcasting-is-a-legit-way-to-speed-up-performance/5271>\
**Category:** General\
**Created:** [August 17, 2023, 3:21pm UTC](https://discuss.hotwired.dev/t/returning-turbo-frame-and-broadcasting-is-a-legit-way-to-speed-up-performance/5271 "2023-08-17T15:21:56Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![crespire](https://yyz1.discourse-cdn.com/flex027/user_avatar/discuss.hotwired.dev/crespire/32/2910_2.png) [@crespire](https://discuss.hotwired.dev/u/crespire)\
**Post date:** [August 28, 2023, 1:41pm UTC](https://discuss.hotwired.dev/t/returning-turbo-frame-and-broadcasting-is-a-legit-way-to-speed-up-performance/5271/2 "2023-08-28T13:41:56Z")

</div>

I ended up running into this issue as well in a system test where the broadcast I was expecting was not firing because it would only get queued.

I solved it like so:

```auto
RSpec.describe 'Some system test', type: :system do
  include ActiveJob::TestHelper

  # set up
  it 'does something' do
    # other test stuff
    perform_enqueued_jobs do
      # This action triggers my broadcast
      click_link 'Delete'
    end
    # Assert changes
  end
end

```

You could probably include the helper in some type of config block and set something like `run_jobs: true` option. There were a few SO posts that set it up like this:

> <https://stackoverflow.com/questions/27859731/execute-pending-job-with-activejob-in-rspec>

---

_[View the full topic](https://discuss.hotwired.dev/t/returning-turbo-frame-and-broadcasting-is-a-legit-way-to-speed-up-performance/5271)._
