Browse files

add activerecord test coverage for `sanitize_sql_array`

check it is handles empty statement
  • Loading branch information...
1 parent 424b2d8 commit ec43584431f61ad56f335033b650a906f44fbf40 @dmitry dmitry committed Feb 9, 2014
Showing with 5 additions and 0 deletions.
  1. +5 −0 activerecord/test/cases/sanitize_test.rb
View
5 activerecord/test/cases/sanitize_test.rb
@@ -46,4 +46,9 @@ def test_sanitize_sql_array_handles_relations
select_author_sql = Post.send(:sanitize_sql_array, ['id in (:post_ids)', post_ids: david_posts])
assert_match(sub_query_pattern, select_author_sql, 'should sanitize `Relation` as subquery for named bind variables')
end
+
+ def test_sanitize_sql_array_handles_empty_statement
+ select_author_sql = Post.send(:sanitize_sql_array, [''])
+ assert_equal('', select_author_sql)
+ end
end

0 comments on commit ec43584

Please sign in to comment.