Permalink
Browse files

Fix test asserting the sanitized SQL hash differently to some adapters

  • Loading branch information...
1 parent 47fb9c0 commit 9d1df380e4c736129c23a228e32bbe1eea01c2b1 @rafaelfranca rafaelfranca committed May 7, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 activerecord/test/cases/sanitize_test.rb
View
8 activerecord/test/cases/sanitize_test.rb
@@ -6,7 +6,13 @@ def setup
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

0 comments on commit 9d1df38

Please sign in to comment.