aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorDmitry Polushkin <dmitry.polushkin@gmail.com>2014-02-09 12:05:42 +0000
committerDmitry Polushkin <dmitry.polushkin@gmail.com>2014-02-09 12:05:42 +0000
commitec43584431f61ad56f335033b650a906f44fbf40 (patch)
tree947f89f96df59b8e163cdee8d7e414d6297e6888 /activerecord
parent424b2d8594121456ed347957714a20c62d09a5cd (diff)
downloadrails-ec43584431f61ad56f335033b650a906f44fbf40.tar.gz
rails-ec43584431f61ad56f335033b650a906f44fbf40.tar.bz2
rails-ec43584431f61ad56f335033b650a906f44fbf40.zip
add activerecord test coverage for `sanitize_sql_array`
check it is handles empty statement
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/sanitize_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/sanitize_test.rb b/activerecord/test/cases/sanitize_test.rb
index 766b2ff2ef..954eab8022 100644
--- a/activerecord/test/cases/sanitize_test.rb
+++ b/activerecord/test/cases/sanitize_test.rb
@@ -46,4 +46,9 @@ class SanitizeTest < ActiveRecord::TestCase
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