Skip to content

Commit 830ab58

Browse files
FrancescoKrafaelfranca
authored andcommitted
A freshly generated Rails project includes a Rubocop linter violation in this line. This edits the file to stick to the listing rules a new Rails project is shipped with by default.
1 parent 9716991 commit 830ab58

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

actionmailbox/test/test_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
ENV["RAILS_INBOUND_EMAIL_PASSWORD"] = "tbsy84uSV1Kt3ZJZELY2TmShPRs91E3yL4tzf96297vBCkDWgL"
77

88
require_relative "../test/dummy/config/environment"
9-
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../test/dummy/db/migrate", __dir__)]
9+
ActiveRecord::Migrator.migrations_paths = [ File.expand_path("../test/dummy/db/migrate", __dir__) ]
1010
require "rails/test_help"
1111

1212
require "webmock/minitest"

actiontext/test/test_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
require_relative "../test/dummy/config/environment"
99
require "active_record/testing/query_assertions"
10-
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../test/dummy/db/migrate", __dir__)]
10+
ActiveRecord::Migrator.migrations_paths = [ File.expand_path("../test/dummy/db/migrate", __dir__) ]
1111
require "rails/test_help"
1212

1313
require "rails/test_unit/reporter"

railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Rails.application.configure do
109109
config.active_record.dump_schema_after_migration = false
110110

111111
# Only use :id for inspections in production.
112-
config.active_record.attributes_for_inspect = [:id]
112+
config.active_record.attributes_for_inspect = [ :id ]
113113
<%- end -%>
114114

115115
# Enable DNS rebinding protection and other `Host` header attacks.

railties/lib/rails/generators/rails/plugin/templates/test/test_helper.rb.tt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ENV["RAILS_ENV"] = "test"
33

44
require_relative "<%= File.join("..", options[:dummy_path], "config/environment") -%>"
55
<% unless options[:skip_active_record] -%>
6-
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../<%= options[:dummy_path] -%>/db/migrate", __dir__)]
6+
ActiveRecord::Migrator.migrations_paths = [ File.expand_path("../<%= options[:dummy_path] -%>/db/migrate", __dir__) ]
77
<% if options[:mountable] -%>
88
ActiveRecord::Migrator.migrations_paths << File.expand_path("../db/migrate", __dir__)
99
<% end -%>
@@ -13,7 +13,7 @@ require "rails/test_help"
1313
<% unless options[:skip_active_record] -%>
1414
# Load fixtures from the engine
1515
if ActiveSupport::TestCase.respond_to?(:fixture_paths=)
16-
ActiveSupport::TestCase.fixture_paths = [File.expand_path("fixtures", __dir__)]
16+
ActiveSupport::TestCase.fixture_paths = [ File.expand_path("fixtures", __dir__) ]
1717
ActionDispatch::IntegrationTest.fixture_paths = ActiveSupport::TestCase.fixture_paths
1818
ActiveSupport::TestCase.file_fixture_path = File.expand_path("fixtures", __dir__) + "/files"
1919
ActiveSupport::TestCase.fixtures :all

railties/test/generators/shared_generator_tests.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,16 @@ def test_target_rails_prerelease_with_relative_app_path
385385
assert_file "myproject/Gemfile", %r{^gem ["']rails["'], github: ["']rails/rails["'], branch: ["']main["']$}
386386
end
387387

388+
def test_generated_files_have_no_rubocop_warnings
389+
run_generator
390+
391+
Dir.chdir(destination_root) do
392+
output = `./bin/rubocop`
393+
394+
assert_predicate $?, :success?, "bin/rubocop did not exit successfully:\n#{output}"
395+
end
396+
end
397+
388398
private
389399
def assert_load_defaults
390400
end

0 commit comments

Comments
 (0)