diff options
author | utilum <oz@utilum.com> | 2018-05-27 20:50:04 +0200 |
---|---|---|
committer | utilum <oz@utilum.com> | 2018-05-31 17:48:20 +0200 |
commit | 84854d9d05c10b091a03767359c3c6ccf4450f26 (patch) | |
tree | 387c5a07d6566fe5e089da9b89fde583a2b40557 /actioncable/test/channel/broadcasting_test.rb | |
parent | 565ce0eaba233fcdd196c11715a8740bd571fd31 (diff) | |
download | rails-84854d9d05c10b091a03767359c3c6ccf4450f26.tar.gz rails-84854d9d05c10b091a03767359c3c6ccf4450f26.tar.bz2 rails-84854d9d05c10b091a03767359c3c6ccf4450f26.zip |
Use minitest/mock instead of mocha
Diffstat (limited to 'actioncable/test/channel/broadcasting_test.rb')
-rw-r--r-- | actioncable/test/channel/broadcasting_test.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/actioncable/test/channel/broadcasting_test.rb b/actioncable/test/channel/broadcasting_test.rb index ab58f33511..f184147c51 100644 --- a/actioncable/test/channel/broadcasting_test.rb +++ b/actioncable/test/channel/broadcasting_test.rb @@ -1,10 +1,13 @@ # frozen_string_literal: true require "test_helper" +require "active_support/testing/method_call_assertions" require "stubs/test_connection" require "stubs/room" class ActionCable::Channel::BroadcastingTest < ActiveSupport::TestCase + include ActiveSupport::Testing::MethodCallAssertions + class ChatChannel < ActionCable::Channel::Base end @@ -13,8 +16,16 @@ class ActionCable::Channel::BroadcastingTest < ActiveSupport::TestCase end test "broadcasts_to" do - ActionCable.stubs(:server).returns mock().tap { |m| m.expects(:broadcast).with("action_cable:channel:broadcasting_test:chat:Room#1-Campfire", "Hello World") } - ChatChannel.broadcast_to(Room.new(1), "Hello World") + assert_called_with( + ActionCable.server, + :broadcast, + [ + "action_cable:channel:broadcasting_test:chat:Room#1-Campfire", + "Hello World" + ] + ) do + ChatChannel.broadcast_to(Room.new(1), "Hello World") + end end test "broadcasting_for with an object" do |