Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assert_turbo_stream: accept a count #452

Merged
merged 2 commits into from Jun 21, 2023

Conversation

ghiculescu
Copy link
Contributor

This PR allows you to provide a count keyword argument to assert_turbo_stream. The argument is just passed on to assert_select.

For example, if you expect a controller to remove 4 elements, you could do:

assert_turbo_stream action: :remove, count: 4

Copy link
Contributor

@alexandreruban alexandreruban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea!

@dhh
Copy link
Member

dhh commented Jun 20, 2023

Needs a rebase and documentation update 👍

This PR allows you to provide a `count` keyword argument to `assert_turbo_stream`. The argument is just passed on to `assert_select`.

For example, if you expect a controller to remove 4 elements, you could do:

```ruby
assert_turbo_stream action: :remove, count: 4
```
@ghiculescu
Copy link
Contributor Author

@dhh done!

* main:
  Update compile turbo js
@dhh dhh merged commit 59ba919 into hotwired:main Jun 21, 2023
11 checks passed
@ghiculescu ghiculescu deleted the assert_turbo_stream-count branch June 21, 2023 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants