Returning turbo_frame and broadcasting is a legit way to speed up performance?

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:

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:

1 Like