diff options
author | George Claghorn <george.claghorn@gmail.com> | 2018-08-23 09:34:27 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-23 09:34:27 -0400 |
commit | a0b57bbb21ce81071220bd8c6cfd8cdda342c6c6 (patch) | |
tree | 03a805bdda4b782398ad9402cbe1630202ee4443 /actioncable/lib | |
parent | 4b4207af2fbec0f6e0171ca637e71b9801cbc65c (diff) | |
parent | 86e7de7968b91bd4256bb07ffbe689b385180910 (diff) | |
download | rails-a0b57bbb21ce81071220bd8c6cfd8cdda342c6c6.tar.gz rails-a0b57bbb21ce81071220bd8c6cfd8cdda342c6c6.tar.bz2 rails-a0b57bbb21ce81071220bd8c6cfd8cdda342c6c6.zip |
Merge pull request #33703 from bogdanvlviv/follow-up-33659
Follow up #33659
Diffstat (limited to 'actioncable/lib')
-rw-r--r-- | actioncable/lib/action_cable/subscription_adapter/test.rb | 2 | ||||
-rw-r--r-- | actioncable/lib/action_cable/test_helper.rb | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/actioncable/lib/action_cable/subscription_adapter/test.rb b/actioncable/lib/action_cable/subscription_adapter/test.rb index 52226a7c71..ce604cc88e 100644 --- a/actioncable/lib/action_cable/subscription_adapter/test.rb +++ b/actioncable/lib/action_cable/subscription_adapter/test.rb @@ -9,7 +9,7 @@ module ActionCable # The test adapter should be used only in testing. Along with # <tt>ActionCable::TestHelper</tt> it makes a great tool to test your Rails application. # - # To use the test adapter set adapter value to +test+ in your +cable.yml+. + # To use the test adapter set +adapter+ value to +test+ in your +config/cable.yml+ file. # # NOTE: Test adapter extends the <tt>ActionCable::SubscriptionsAdapter::Async</tt> adapter, # so it could be used in system tests too. diff --git a/actioncable/lib/action_cable/test_helper.rb b/actioncable/lib/action_cable/test_helper.rb index dbd5ec3b16..7bc877663c 100644 --- a/actioncable/lib/action_cable/test_helper.rb +++ b/actioncable/lib/action_cable/test_helper.rb @@ -47,11 +47,12 @@ module ActionCable original_count = broadcasts_size(stream) yield new_count = broadcasts_size(stream) - assert_equal number, new_count - original_count, "#{number} broadcasts to #{stream} expected, but #{new_count - original_count} were sent" + actual_count = new_count - original_count else actual_count = broadcasts_size(stream) - assert_equal number, actual_count, "#{number} broadcasts to #{stream} expected, but #{actual_count} were sent" end + + assert_equal number, actual_count, "#{number} broadcasts to #{stream} expected, but #{actual_count} were sent" end # Asserts that no messages have been sent to the stream. @@ -125,7 +126,7 @@ module ActionCable delegate :broadcasts, :clear_messages, to: :pubsub_adapter private - def broadcasts_size(channel) # :nodoc: + def broadcasts_size(channel) broadcasts(channel).size end end |