aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorYoshiyuki Hirano <yhirano@me.com>2018-04-22 12:24:27 +0900
committerYoshiyuki Hirano <yhirano@me.com>2018-04-22 12:24:27 +0900
commit4ee80f25ce9790c6eaedb2da27d0f25b397aa93d (patch)
treef25659e1d7dd9b9730ae8c30ec5560433014bf2c /railties
parent58e18c1aaf136e80dead3a93fc0a301066768767 (diff)
downloadrails-4ee80f25ce9790c6eaedb2da27d0f25b397aa93d.tar.gz
rails-4ee80f25ce9790c6eaedb2da27d0f25b397aa93d.tar.bz2
rails-4ee80f25ce9790c6eaedb2da27d0f25b397aa93d.zip
Add test case to ChannelGeneratorTest
* Add a test case to ensure avoid duplicated suffix in channel generator
Diffstat (limited to 'railties')
-rw-r--r--railties/test/generators/channel_generator_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/railties/test/generators/channel_generator_test.rb b/railties/test/generators/channel_generator_test.rb
index e238197eba..e543cc11b8 100644
--- a/railties/test/generators/channel_generator_test.rb
+++ b/railties/test/generators/channel_generator_test.rb
@@ -76,4 +76,14 @@ class ChannelGeneratorTest < Rails::Generators::TestCase
assert_file "app/channels/application_cable/connection.rb"
assert_file "app/assets/javascripts/cable.js"
end
+
+ def test_channel_suffix_is_not_duplicated
+ run_generator ["chat_channel"]
+
+ assert_no_file "app/channels/chat_channel_channel.rb"
+ assert_file "app/channels/chat_channel.rb"
+
+ assert_no_file "app/assets/javascripts/channels/chat_channel.js"
+ assert_file "app/assets/javascripts/channels/chat.js"
+ end
end