All threads / Testing Rails ActionCable Channel
Ask A Question

Notifications

You’re not receiving notifications from this thread.

Testing Rails ActionCable Channel

Kyle Jobbins asked in Rails

I followed along with the Online user tracking with ActionCable and was able to get it all working. I replicated a similar channel in another app and again it works great, however when I came to test the channel I hit a problem.

The problem:
Inside the the 'subscribed' method of the channel I am using the same 'ActionCable.serve.pubsub.redis_connection_for_subscriptions ...' as in the Online user tracking, this works fine in development, but when it comes to testing I get the following error;

NoMethodError: undefined methodredis_connection_for_subcsriptions' for #ActionCable::SubscriptionAdapter::Test:0x00007fbd5969d3e0`

I have dug around to try and figure out what is causing this and why but have not had any luck so far. Has anyone seen this error when working with/testing action cable channels, and how did you fix it ?

Thanks in advance

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 66,029+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2022 GoRails, LLC. All rights reserved.