diff options
author | Yoshiyuki Hirano <yhirano@me.com> | 2018-04-22 12:24:27 +0900 |
---|---|---|
committer | Yoshiyuki Hirano <yhirano@me.com> | 2018-04-22 12:24:27 +0900 |
commit | 4ee80f25ce9790c6eaedb2da27d0f25b397aa93d (patch) | |
tree | f25659e1d7dd9b9730ae8c30ec5560433014bf2c /railties | |
parent | 58e18c1aaf136e80dead3a93fc0a301066768767 (diff) | |
download | rails-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.rb | 10 |
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 |