How can I test ActionCable channels using RSpec?

后端 未结 4 1499
刺人心
刺人心 2021-01-01 19:25

I am wondering how to test ActionCable channels.

Let\'s say I have the following chat channel:

class ChatChannel < ApplicationCable::Channel
  def s         


        
4条回答
  •  旧时难觅i
    2021-01-01 19:53

    You probably want to wait* for https://github.com/rails/rails/pull/23211 to be merged. It adds ActionCable::TestCase. Once that's merged, expect the rspec-rails team to do its part: https://github.com/rspec/rspec-rails/issues/1606

    * Waiting is optional; You can not wait and based your own work on this "work in progress" and find a solution that works right now.

提交回复
热议问题