aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorRichard Schneeman <richard.schneeman+no-recruiters@gmail.com>2018-07-25 16:00:33 -0500
committerGitHub <noreply@github.com>2018-07-25 16:00:33 -0500
commit91fd679710118482f718ea710710561f1cfb0b70 (patch)
tree9169aa6ea2315b16f77e530dd2c6a4eda1816769 /activerecord/test/cases
parentab8847c92092a57df6433f4fc72682074359531f (diff)
parentd108288c2f684233298f97f18ac00de0b016deaa (diff)
downloadrails-91fd679710118482f718ea710710561f1cfb0b70.tar.gz
rails-91fd679710118482f718ea710710561f1cfb0b70.tar.bz2
rails-91fd679710118482f718ea710710561f1cfb0b70.zip
Merge pull request #32381 from q-centrix/update-codeclimate-configs
Turn on performance based cops
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/relation_test.rb2
-rw-r--r--activerecord/test/cases/tasks/database_tasks_test.rb24
2 files changed, 13 insertions, 13 deletions
diff --git a/activerecord/test/cases/relation_test.rb b/activerecord/test/cases/relation_test.rb
index fbeb617b29..3ca15640fd 100644
--- a/activerecord/test/cases/relation_test.rb
+++ b/activerecord/test/cases/relation_test.rb
@@ -187,7 +187,7 @@ module ActiveRecord
end
relation = Relation.new(klass)
- relation.merge!(where: ["foo = ?", "bar"])
+ relation.merge!(where: ["foo = ?", "bar"]) # rubocop:disable Performance/RedundantMerge
assert_equal Relation::WhereClause.new(["foo = bar"]), relation.where_clause
end
diff --git a/activerecord/test/cases/tasks/database_tasks_test.rb b/activerecord/test/cases/tasks/database_tasks_test.rb
index b9cc08c446..a6efe3fa5e 100644
--- a/activerecord/test/cases/tasks/database_tasks_test.rb
+++ b/activerecord/test/cases/tasks/database_tasks_test.rb
@@ -152,7 +152,7 @@ module ActiveRecord
end
def test_ignores_configurations_without_databases
- @configurations["development"].merge!("database" => nil)
+ @configurations["development"]["database"] = nil
with_stubbed_configurations_establish_connection do
assert_not_called(ActiveRecord::Tasks::DatabaseTasks, :create) do
@@ -162,7 +162,7 @@ module ActiveRecord
end
def test_ignores_remote_databases
- @configurations["development"].merge!("host" => "my.server.tld")
+ @configurations["development"]["host"] = "my.server.tld"
with_stubbed_configurations_establish_connection do
assert_not_called(ActiveRecord::Tasks::DatabaseTasks, :create) do
@@ -172,7 +172,7 @@ module ActiveRecord
end
def test_warning_for_remote_databases
- @configurations["development"].merge!("host" => "my.server.tld")
+ @configurations["development"]["host"] = "my.server.tld"
with_stubbed_configurations_establish_connection do
ActiveRecord::Tasks::DatabaseTasks.create_all
@@ -183,7 +183,7 @@ module ActiveRecord
end
def test_creates_configurations_with_local_ip
- @configurations["development"].merge!("host" => "127.0.0.1")
+ @configurations["development"]["host"] = "127.0.0.1"
with_stubbed_configurations_establish_connection do
assert_called(ActiveRecord::Tasks::DatabaseTasks, :create) do
@@ -193,7 +193,7 @@ module ActiveRecord
end
def test_creates_configurations_with_local_host
- @configurations["development"].merge!("host" => "localhost")
+ @configurations["development"]["host"] = "localhost"
with_stubbed_configurations_establish_connection do
assert_called(ActiveRecord::Tasks::DatabaseTasks, :create) do
@@ -203,7 +203,7 @@ module ActiveRecord
end
def test_creates_configurations_with_blank_hosts
- @configurations["development"].merge!("host" => nil)
+ @configurations["development"]["host"] = nil
with_stubbed_configurations_establish_connection do
assert_called(ActiveRecord::Tasks::DatabaseTasks, :create) do
@@ -463,7 +463,7 @@ module ActiveRecord
end
def test_ignores_configurations_without_databases
- @configurations[:development].merge!("database" => nil)
+ @configurations[:development]["database"] = nil
ActiveRecord::Base.stub(:configurations, @configurations) do
assert_not_called(ActiveRecord::Tasks::DatabaseTasks, :drop) do
@@ -473,7 +473,7 @@ module ActiveRecord
end
def test_ignores_remote_databases
- @configurations[:development].merge!("host" => "my.server.tld")
+ @configurations[:development]["host"] = "my.server.tld"
ActiveRecord::Base.stub(:configurations, @configurations) do
assert_not_called(ActiveRecord::Tasks::DatabaseTasks, :drop) do
@@ -483,7 +483,7 @@ module ActiveRecord
end
def test_warning_for_remote_databases
- @configurations[:development].merge!("host" => "my.server.tld")
+ @configurations[:development]["host"] = "my.server.tld"
ActiveRecord::Base.stub(:configurations, @configurations) do
ActiveRecord::Tasks::DatabaseTasks.drop_all
@@ -494,7 +494,7 @@ module ActiveRecord
end
def test_drops_configurations_with_local_ip
- @configurations[:development].merge!("host" => "127.0.0.1")
+ @configurations[:development]["host"] = "127.0.0.1"
ActiveRecord::Base.stub(:configurations, @configurations) do
assert_called(ActiveRecord::Tasks::DatabaseTasks, :drop) do
@@ -504,7 +504,7 @@ module ActiveRecord
end
def test_drops_configurations_with_local_host
- @configurations[:development].merge!("host" => "localhost")
+ @configurations[:development]["host"] = "localhost"
ActiveRecord::Base.stub(:configurations, @configurations) do
assert_called(ActiveRecord::Tasks::DatabaseTasks, :drop) do
@@ -514,7 +514,7 @@ module ActiveRecord
end
def test_drops_configurations_with_blank_hosts
- @configurations[:development].merge!("host" => nil)
+ @configurations[:development]["host"] = nil
ActiveRecord::Base.stub(:configurations, @configurations) do
assert_called(ActiveRecord::Tasks::DatabaseTasks, :drop) do