Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | fix fixture syntax in cable docs and guides | Vladimir Dementyev | 2019-01-22 | 1 | -3/+3 |
| | |||||
* | Move `channel_name` to Channel.broadcasting_for | Vladimir Dementyev | 2019-01-22 | 1 | -3/+1 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That would allow us to test broadcasting made with channel, e.g.: ```ruby class ChatRelayJob < ApplicationJob def perform_later(room, msg) ChatChannel.broadcast_to room, message: msg end end ``` To test this functionality we need to know the underlying stream name (to use `assert_broadcasts`), which relies on `channel_name`. We had to use the following code: ```ruby assert_broadcasts(ChatChannel.broadcasting_for([ChatChannel.channel_name, room]), 1) do ChatRelayJob.perform_now end ``` The problem with this approach is that we use _internal_ API (we shouldn't care about `channel_name` prefix in our code). With this commit we could re-write the test as following: ```ruby assert_broadcasts(ChatChannel.broadcasting_for(room), 1) do ChatRelayJob.perform_now end ``` | ||||
* | Add streams assert methods to ActionCable channel test case | Sergey Ponomarev | 2018-12-18 | 1 | -4/+45 |
| | |||||
* | Fix typos | R.T. Lechow | 2018-10-01 | 1 | -2/+2 |
| | | | | Fixes some typos. | ||||
* | Remove Rails 5.0 workaround from ActionCable::Channel::TestCase | Vladimir Dementyev | 2018-09-27 | 1 | -6/+2 |
| | | | | | | | The hack was merged from action-cable-testing gem by mistake. We don't need it in Rails 6. (cherry picked from commit 92030ec4b4309835ed0e792229984a1f0a044cef) | ||||
* | Add ActionCable::Channel::TestCase | Vladimir Dementyev | 2018-09-26 | 1 | -0/+275 |
ActionCable::Channel::TestCase provides an ability to unit-test channel classes. There are several reasons to write unit/functional cable tests: - Access control (who has access to the channel? who can perform action and with which argument? - Frontend-less applications have no system tests at all–and we still need a way to test channels logic. See also #27191 |