aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorJon Moss <me@jonathanmoss.me>2016-02-10 17:36:11 -0500
committerJon Moss <me@jonathanmoss.me>2016-02-22 20:46:06 -0500
commit83921b8f87495d5edb66f67549f0c169d2ea3e73 (patch)
treea68ca13b282561b64c96579b08b380f4938ade40 /railties
parent1813b29fc7632959800252f36e4b2e6ed4ac7266 (diff)
downloadrails-83921b8f87495d5edb66f67549f0c169d2ea3e73.tar.gz
rails-83921b8f87495d5edb66f67549f0c169d2ea3e73.tar.bz2
rails-83921b8f87495d5edb66f67549f0c169d2ea3e73.zip
Generate ApplicationCable files if they do not already exist
Diffstat (limited to 'railties')
-rw-r--r--railties/test/generators/channel_generator_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/railties/test/generators/channel_generator_test.rb b/railties/test/generators/channel_generator_test.rb
index c1f0c03fbf..e31736a74c 100644
--- a/railties/test/generators/channel_generator_test.rb
+++ b/railties/test/generators/channel_generator_test.rb
@@ -5,6 +5,18 @@ class ChannelGeneratorTest < Rails::Generators::TestCase
include GeneratorsTestHelper
tests Rails::Generators::ChannelGenerator
+ def test_application_cable_skeleton_is_created
+ run_generator ['books']
+
+ assert_file "app/channels/application_cable/channel.rb" do |cable|
+ assert_match(/module ApplicationCable\n class Channel < ActionCable::Channel::Base\n/, cable)
+ end
+
+ assert_file "app/channels/application_cable/connection.rb" do |cable|
+ assert_match(/module ApplicationCable\n class Connection < ActionCable::Connection::Base\n/, cable)
+ end
+ end
+
def test_channel_is_created
run_generator ['chat']