mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #22727 from prathamesh-sonpatki/fix-master
Ensure that assets are enabled back after the test that tests assets are disabled
This commit is contained in:
commit
daa890331e
1 changed files with 4 additions and 1 deletions
|
@ -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 @@ class ChannelGeneratorTest < Rails::Generators::TestCase
|
|||
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 @@ class ChannelGeneratorTest < Rails::Generators::TestCase
|
|||
end
|
||||
|
||||
assert_no_file "app/assets/javascripts/channels/chat.coffee"
|
||||
ensure
|
||||
Rails::Generators.options[:rails][:assets] = enable_assets
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue