-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add Action Cable testing #2113
Add Action Cable testing #2113
Conversation
@benoittgt @samphippen Hey folks, what should I do to make Travis show me the failures?) |
Hello @palkan Sorry busy weekend. Maybe you can comment those lines? I will have a look on your PR tomorrow. Thanks for the hard work. |
@palkan please rebase this on top of the 4-0-dev branch, as this'll have to make it in to 4-0 at this point. |
Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good job. I have few questions related to documentation but also where matcher are defined.
@benoittgt @JonRowe thanks for the feedback! All fixed. @samphippen The build seems green: https://travis-ci.org/rspec/rspec-rails/builds/526676636 (Rails 4.2 specs are failing for non-related to this PR reasons, looks it's no longer supported?). |
@samphippen can you give me a final review for this, you're more familiar with action cable! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is overall a high quality PR, I had a few nits, but if you can address them, I'll merge this down!
end | ||
end | ||
|
||
if ::Rails::VERSION::MAJOR > 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT about >= 6
?
# expect { | ||
# ActionCable.server.broadcast "messages", text: 'Hi!' | ||
# }.to have_broadcasted_to("messages").with(text: 'Hi!') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to kill this blankline.
@palkan BTW you should feel free to DM me on twitter if you need my attention, it is by far and away my fastest response time channel. |
LGTM, will merge on green! |
Looks like we're blocked by RuboCop again (0.69 release notes) @benoittgt @samphippen Is anyone going to fix this in |
action-cable-testing migration, pt.1
@benoittgt My bad, I should have checked( Anyway, we're green 🎉 |
Thanks a lot @palkan. Awesome job! 👏 |
How to test cases this chat_channel.rb file |
@shyam04261996 please use our help channels http://rspec.info/help/ or Stackoverflow. |
This PR migrates
action-cable-testing
gem RSpec functionality intorspec-rails
(since core functionality has been merged into Rails 6).You can check the existing gem documentation (RSpec-like) to see what's coming: https://relishapp.com/palkan/action-cable-testing/docs.
What's inside:
@rails_post_6
tag for 🥒have_broadcasted_to
/broadcast_to
matcher (=> corresponds to Action cable testing rails/rails#33659)Closes #1606