File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
actioncable/lib/action_cable Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -29,17 +29,21 @@ def after_teardown # :nodoc:
29
29
# end
30
30
#
31
31
# If a block is passed, that block should cause the specified number of
32
- # messages to be broadcasted.
32
+ # messages to be broadcasted. It returns the messages that were broadcasted.
33
33
#
34
34
# def test_broadcasts_again
35
- # assert_broadcasts('messages', 1) do
35
+ # message = assert_broadcasts('messages', 1) do
36
36
# ActionCable.server.broadcast 'messages', { text: 'hello' }
37
37
# end
38
+ # assert_equal({ text: 'hello' }, message)
38
39
#
39
- # assert_broadcasts('messages', 2) do
40
+ # messages = assert_broadcasts('messages', 2) do
40
41
# ActionCable.server.broadcast 'messages', { text: 'hi' }
41
42
# ActionCable.server.broadcast 'messages', { text: 'how are you?' }
42
43
# end
44
+ # assert_equal 2, messages.length
45
+ # assert_equal({ text: 'hi' }, messages.first)
46
+ # assert_equal({ text: 'how are you?' }, messages.last)
43
47
# end
44
48
#
45
49
def assert_broadcasts ( stream , number , &block )
You can’t perform that action at this time.
0 commit comments