提交 39ea2b09 编写于 作者: K Kasper Timm Hansen

Merge pull request #23206 from joyvuu-dave/action_cable_api_fix

prevent --skip-action-cable from erroring when --api option is used
......@@ -318,7 +318,7 @@ def delete_action_cable_files_skipping_action_cable
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/, ''
gsub_file 'app/views/layouts/application.html.erb', /action_cable_meta_tag/, '' unless options[:api]
end
end
......
......@@ -405,6 +405,18 @@ def test_generator_if_skip_action_cable_is_given
end
end
def test_generator_if_skip_action_cable_is_given_for_an_api_app
run_generator [destination_root, "--skip-action-cable", "--api"]
assert_file "config/application.rb", /#\s+require\s+["']action_cable\/engine["']/
assert_no_file "config/cable.yml"
assert_no_file "app/assets/javascripts/cable.coffee"
assert_no_file "app/channels"
assert_file "Gemfile" do |content|
assert_no_match(/em-hiredis/, content)
assert_no_match(/redis/, content)
end
end
def test_action_cable_redis_gems
run_generator
assert_gem 'em-hiredis'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册