mirror of https://github.com/rails/rails
Merge pull request #44393 from Edouard-chin/ec-class-module-children
Add module/class nesting consistency on newly generated application:
This commit is contained in:
commit
965367e390
|
@ -1,11 +1,13 @@
|
|||
require "test_helper"
|
||||
|
||||
class ApplicationCable::ConnectionTest < ActionCable::Connection::TestCase
|
||||
# test "connects with cookies" do
|
||||
# cookies.signed[:user_id] = 42
|
||||
#
|
||||
# connect
|
||||
#
|
||||
# assert_equal connection.user_id, "42"
|
||||
# end
|
||||
module ApplicationCable
|
||||
class ConnectionTest < ActionCable::Connection::TestCase
|
||||
# test "connects with cookies" do
|
||||
# cookies.signed[:user_id] = 42
|
||||
#
|
||||
# connect
|
||||
#
|
||||
# assert_equal connection.user_id, "42"
|
||||
# end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,18 +2,20 @@ ENV["RAILS_ENV"] ||= "test"
|
|||
require_relative "../config/environment"
|
||||
require "rails/test_help"
|
||||
|
||||
class ActiveSupport::TestCase
|
||||
# Run tests in parallel with specified workers
|
||||
module ActiveSupport
|
||||
class TestCase
|
||||
# Run tests in parallel with specified workers
|
||||
<% if Process.respond_to?(:fork) && !Gem.win_platform? -%>
|
||||
parallelize(workers: :number_of_processors)
|
||||
parallelize(workers: :number_of_processors)
|
||||
<%- else -%>
|
||||
parallelize(workers: :number_of_processors, with: :threads)
|
||||
parallelize(workers: :number_of_processors, with: :threads)
|
||||
<% end -%>
|
||||
|
||||
<% unless options[:skip_active_record] -%>
|
||||
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
|
||||
fixtures :all
|
||||
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
|
||||
fixtures :all
|
||||
|
||||
<% end -%>
|
||||
# Add more helper methods to be used by all tests here...
|
||||
# Add more helper methods to be used by all tests here...
|
||||
end
|
||||
end
|
||||
|
|
|
@ -182,7 +182,7 @@ module ApplicationTests
|
|||
end
|
||||
|
||||
def test_code_statistics
|
||||
assert_match "Code LOC: 62 Test LOC: 3 Code to Test Ratio: 1:0.0",
|
||||
assert_match "Code LOC: 62 Test LOC: 5 Code to Test Ratio: 1:0.1",
|
||||
rails("stats")
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue