1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix test asserting the sanitized SQL hash differently to some adapters

This commit is contained in:
Rafael Mendonça França 2013-05-06 22:00:11 -03:00
parent 9073400253
commit 0f97ac6647

View file

@ -6,7 +6,13 @@ class SanitizeTest < ActiveRecord::TestCase
end
def test_sanitize_sql_hash_handles_associations
assert_equal "`adorable_animals`.`name` = 'Bambi'", Binary.send(:sanitize_sql_hash, {adorable_animals: {name: 'Bambi'}})
if current_adapter?(:MysqlAdapter, :Mysql2Adapter)
expected_value = "`adorable_animals`.`name` = 'Bambi'"
else
expected_value = "\"adorable_animals\".\"name\" = 'Bambi'"
end
assert_equal expected_value, Binary.send(:sanitize_sql_hash, {adorable_animals: {name: 'Bambi'}})
end
def test_sanitize_sql_array_handles_string_interpolation