diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-09-27 13:34:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-27 13:34:35 -0400 |
commit | dc06e40d4f0aeb50672983449c51731b74c60c88 (patch) | |
tree | abd1e351fe3ca67933df7a49abf19043f37b765e | |
parent | 96712e3f0ed6b82a1bb7e5689aea6f561161f95b (diff) | |
parent | e229346c9e53b119b82eec33411f1152d6a3e075 (diff) | |
download | rails-dc06e40d4f0aeb50672983449c51731b74c60c88.tar.gz rails-dc06e40d4f0aeb50672983449c51731b74c60c88.tar.bz2 rails-dc06e40d4f0aeb50672983449c51731b74c60c88.zip |
Merge pull request #34003 from palkan/fix/cable-test-case-rails5-hack
Remove Rails 5.0 workaround from ActionCable::Channel::TestCase
-rw-r--r-- | actioncable/lib/action_cable/channel/test_case.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/actioncable/lib/action_cable/channel/test_case.rb b/actioncable/lib/action_cable/channel/test_case.rb index 88d7c7092b..a26051d687 100644 --- a/actioncable/lib/action_cable/channel/test_case.rb +++ b/actioncable/lib/action_cable/channel/test_case.rb @@ -215,13 +215,9 @@ module ActionCable # Subsribe to the channel under test. Optionally pass subscription parameters as a Hash. def subscribe(params = {}) @connection ||= stub_connection - # NOTE: Rails < 5.0.1 calls subscribe_to_channel during #initialize. - # We have to stub before it - @subscription = self.class.channel_class.allocate + @subscription = self.class.channel_class.new(connection, CHANNEL_IDENTIFIER, params.with_indifferent_access) @subscription.singleton_class.include(ChannelStub) - @subscription.send(:initialize, connection, CHANNEL_IDENTIFIER, params.with_indifferent_access) - # Call subscribe_to_channel if it's public (Rails 5.0.1+) - @subscription.subscribe_to_channel if ActionCable.gem_version >= Gem::Version.new("5.0.1") + @subscription.subscribe_to_channel @subscription end |