Skip to content

feat: Minitest broadcast assertions — assert/refute_broadcasted_turbo_stream_to#40

Merged
eclectic-coding merged 1 commit into
mainfrom
feat/1.6-minitest-broadcast-assertions
Jun 2, 2026
Merged

feat: Minitest broadcast assertions — assert/refute_broadcasted_turbo_stream_to#40
eclectic-coding merged 1 commit into
mainfrom
feat/1.6-minitest-broadcast-assertions

Conversation

@eclectic-coding

Copy link
Copy Markdown
Owner

Closes #33.

Summary

Adds assert_broadcasted_turbo_stream_to and refute_broadcasted_turbo_stream_to to TurboRspec::Assertions, giving Minitest the same broadcast assertion surface as the RSpec have_broadcasted_turbo_stream_to matcher.

# Assert any broadcast to the stream
assert_broadcasted_turbo_stream_to("notifications") { MyJob.perform_now }

# Assert with constraints
assert_broadcasted_turbo_stream_to("notifications", action: :append, target: "messages") { MyJob.perform_now }

# Refute
refute_broadcasted_turbo_stream_to("notifications") { MyJob.perform_now }

Both methods accept action:, target:, targets:, content:, partial:, and message: keyword arguments. Requires ActionCable's test adapter, same as the RSpec counterpart.

Test plan

  • 325 examples, 0 failures
  • 100% line and branch coverage

🤖 Generated with Claude Code

…_stream_to

Closes #33.

Adds assert_broadcasted_turbo_stream_to and
refute_broadcasted_turbo_stream_to to TurboRspec::Assertions, giving
Minitest the same broadcast assertion surface as the RSpec
have_broadcasted_turbo_stream_to matcher. Supports action, target,
targets, content, partial, and custom message keyword arguments.

325 examples, 100% line and branch coverage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@eclectic-coding
eclectic-coding merged commit e956ed9 into main Jun 2, 2026
11 checks passed
@eclectic-coding
eclectic-coding deleted the feat/1.6-minitest-broadcast-assertions branch June 2, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Minitest broadcast assertions — assert_broadcasted_turbo_stream_to

1 participant