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:
parent
9073400253
commit
0f97ac6647
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue