提交 8b8b6e93 编写于 作者: P Prathamesh Sonpatki

Ensure that assets are enabled back after the test that tests assets are disabled

上级 78b523d1
......@@ -7,7 +7,7 @@ class ChannelGeneratorTest < Rails::Generators::TestCase
def test_channel_is_created
run_generator ['chat']
assert_file "app/channels/chat_channel.rb" do |channel|
assert_match(/class ChatChannel < ApplicationCable::Channel/, channel)
end
......@@ -18,6 +18,7 @@ def test_channel_is_created
end
def test_channel_asset_is_not_created
enable_assets = Rails::Generators.options[:rails][:assets]
Rails::Generators.options[:rails][:assets] = false
run_generator ['chat']
......@@ -26,5 +27,7 @@ def test_channel_asset_is_not_created
end
assert_no_file "app/assets/javascripts/channels/chat.coffee"
ensure
Rails::Generators.options[:rails][:assets] = enable_assets
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册