Skip to content

Commit

Permalink
Fix tests related to new JavaScript path for generators
Browse files Browse the repository at this point in the history
- Followup of 4838c17
  • Loading branch information
prathamesh-sonpatki committed Oct 5, 2018
1 parent 1ceaf7d commit 2690c41
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion railties/test/generators/app_generator_test.rb
Expand Up @@ -603,7 +603,7 @@ def test_does_not_generate_system_test_files_if_skip_system_test_is_given
def test_javascript_is_skipped_if_required
run_generator [destination_root, "--skip-javascript"]

assert_no_file "app/assets/javascripts"
assert_no_file "app/javascript"

assert_file "app/views/layouts/application.html.erb" do |contents|
assert_match(/stylesheet_link_tag\s+'application', media: 'all' %>/, contents)
Expand Down
6 changes: 3 additions & 3 deletions railties/test/generators/channel_generator_test.rb
Expand Up @@ -57,7 +57,7 @@ def test_channel_asset_is_not_created_when_skip_assets_is_passed
assert_no_file "app/javascript/channels/chat_channel.js"
end

def test_cable_js_is_created_if_not_present_already
def test_consumer_js_is_created_if_not_present_already
run_generator ["chat"]
FileUtils.rm("#{destination_root}/app/javascript/channels/index.js")
FileUtils.rm("#{destination_root}/app/javascript/channels/consumer.js")
Expand All @@ -72,7 +72,7 @@ def test_channel_on_revoke
run_generator ["chat"], behavior: :revoke

assert_no_file "app/channels/chat_channel.rb"
assert_no_file "app/assets/javascripts/channels/chat.js"
assert_no_file "app/javascript/channels/chat_channel.js"

assert_file "app/channels/application_cable/channel.rb"
assert_file "app/channels/application_cable/connection.rb"
Expand All @@ -86,7 +86,7 @@ def test_channel_suffix_is_not_duplicated
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_no_file "app/javascript/channels/chat_channel_channel.js"
assert_file "app/javascript/channels/chat_channel.js"
end
end
2 changes: 0 additions & 2 deletions railties/test/generators/controller_generator_test.rb
Expand Up @@ -130,8 +130,6 @@ def test_controller_suffix_is_not_duplicated
assert_no_file "app/helpers/account_controller_helper.rb"
assert_file "app/helpers/account_helper.rb"

assert_no_file "app/assets/javascripts/account_controller.js"

assert_no_file "app/assets/stylesheets/account_controller.css"
assert_file "app/assets/stylesheets/account.css"
end
Expand Down
4 changes: 2 additions & 2 deletions railties/test/generators/shared_generator_tests.rb
Expand Up @@ -305,8 +305,8 @@ def test_generator_if_skip_action_cable_is_given
run_generator [destination_root, "--skip-action-cable"]
assert_file "#{application_path}/config/application.rb", /#\s+require\s+["']action_cable\/engine["']/
assert_no_file "#{application_path}/config/cable.yml"
assert_no_file "#{application_path}/app/assets/javascripts/cable.js"
assert_no_directory "#{application_path}/app/assets/javascripts/channels"
assert_no_file "#{application_path}/app/javascript/consumer.js"
assert_no_directory "#{application_path}/app/javascript/channels"
assert_no_directory "#{application_path}/app/channels"
assert_file "Gemfile" do |content|
assert_no_match(/redis/, content)
Expand Down

0 comments on commit 2690c41

Please sign in to comment.