aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/sanitize_test.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/activerecord/test/cases/sanitize_test.rb b/activerecord/test/cases/sanitize_test.rb
index f061c28e88..082570c55b 100644
--- a/activerecord/test/cases/sanitize_test.rb
+++ b/activerecord/test/cases/sanitize_test.rb
@@ -6,11 +6,10 @@ class SanitizeTest < ActiveRecord::TestCase
end
def test_sanitize_sql_hash_handles_associations
- if current_adapter?(:MysqlAdapter, :Mysql2Adapter)
- expected_value = "`adorable_animals`.`name` = 'Bambi'"
- else
- expected_value = "\"adorable_animals\".\"name\" = 'Bambi'"
- end
+ quoted_bambi = ActiveRecord::Base.connection.quote("Bambi")
+ quoted_column_name = ActiveRecord::Base.connection.quote_column_name("name")
+ quoted_table_name = ActiveRecord::Base.connection.quote_table_name("adorable_animals")
+ expected_value = "#{quoted_table_name}.#{quoted_column_name} = #{quoted_bambi}"
assert_equal expected_value, Binary.send(:sanitize_sql_hash, {adorable_animals: {name: 'Bambi'}})
end