diff options
author | JuanitoFatas <katehuang0320@gmail.com> | 2016-01-22 10:21:37 +0800 |
---|---|---|
committer | JuanitoFatas <katehuang0320@gmail.com> | 2016-01-22 10:21:37 +0800 |
commit | cd0d649dc4cbe0bc40871017ab48e2ede8591482 (patch) | |
tree | b6183de2e9d5c5caa1b76ef29c4c411dc9b34329 | |
parent | 6fcc3c47eb363d0d3753ee284de2fbc68df03194 (diff) | |
download | rails-cd0d649dc4cbe0bc40871017ab48e2ede8591482.tar.gz rails-cd0d649dc4cbe0bc40871017ab48e2ede8591482.tar.bz2 rails-cd0d649dc4cbe0bc40871017ab48e2ede8591482.zip |
Remove action_cable_meta_tag when skip action_cable
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 1 | ||||
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index 7ec4d3bbd3..9248e16585 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -318,6 +318,7 @@ module Rails remove_file 'config/cable.yml' remove_file 'app/assets/javascripts/cable.coffee' remove_dir 'app/channels' + gsub_file 'app/views/layouts/application.html.erb', /action_cable_meta_tag/, '' end end diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index c0f7e58b59..35e2e1924d 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -395,6 +395,9 @@ class AppGeneratorTest < Rails::Generators::TestCase assert_no_file "config/cable.yml" assert_no_file "app/assets/javascripts/cable.coffee" assert_no_file "app/channels" + assert_file "app/views/layouts/application.html.erb" do |content| + assert_no_match(/action_cable_meta_tag/, content) + end assert_file "Gemfile" do |content| assert_no_match(/em-hiredis/, content) assert_no_match(/redis/, content) |