mirror of https://github.com/rails/rails
Remove Rubocop's comments from Rails code base
PR#32381 added Rubocop's comments to some tests files in order to exclude `Performance/RedundantMerge`. Turn off `Performance` cops for tests files via `Exclude` in `.rubocop.yml`. Context https://github.com/rails/rails/pull/32381#discussion_r205212331
This commit is contained in:
parent
f0c917c7d4
commit
09ec075f1e
|
@ -9,6 +9,10 @@ AllCops:
|
|||
- 'actionpack/lib/action_dispatch/journey/parser.rb'
|
||||
- 'railties/test/fixtures/tmp/**/*'
|
||||
|
||||
Performance:
|
||||
Exclude:
|
||||
- '**/test/**/*'
|
||||
|
||||
Rails:
|
||||
Enabled: true
|
||||
|
||||
|
|
|
@ -105,20 +105,16 @@ class HeaderTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
test "#merge! headers with mutation" do
|
||||
# rubocop:disable Performance/RedundantMerge
|
||||
@headers.merge!("Host" => "http://example.test",
|
||||
"Content-Type" => "text/html")
|
||||
# rubocop:enable Performance/RedundantMerge
|
||||
assert_equal({ "HTTP_HOST" => "http://example.test",
|
||||
"CONTENT_TYPE" => "text/html",
|
||||
"HTTP_REFERER" => "/some/page" }, @headers.env)
|
||||
end
|
||||
|
||||
test "#merge! env with mutation" do
|
||||
# rubocop:disable Performance/RedundantMerge
|
||||
@headers.merge!("HTTP_HOST" => "http://first.com",
|
||||
"CONTENT_TYPE" => "text/html")
|
||||
# rubocop:enable Performance/RedundantMerge
|
||||
assert_equal({ "HTTP_HOST" => "http://first.com",
|
||||
"CONTENT_TYPE" => "text/html",
|
||||
"HTTP_REFERER" => "/some/page" }, @headers.env)
|
||||
|
|
|
@ -187,7 +187,7 @@ module ActiveRecord
|
|||
end
|
||||
|
||||
relation = Relation.new(klass)
|
||||
relation.merge!(where: ["foo = ?", "bar"]) # rubocop:disable Performance/RedundantMerge
|
||||
relation.merge!(where: ["foo = ?", "bar"])
|
||||
assert_equal Relation::WhereClause.new(["foo = bar"]), relation.where_clause
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue