diff options
author | Michael Koziarski <michael@koziarski.com> | 2013-02-07 23:33:00 -0800 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2013-02-07 23:33:00 -0800 |
commit | bcf0e08a8df372ef1be376587e5bc206c740e5ef (patch) | |
tree | 6d8a30ea2029447d7f95a2ef6052f29b49af3933 /activerecord/test | |
parent | f1637492f12fcf8a45835d9b9009b107c69dc3eb (diff) | |
parent | e170014113154a4fcea3f3ffc2b991a918661e9a (diff) | |
download | rails-bcf0e08a8df372ef1be376587e5bc206c740e5ef.tar.gz rails-bcf0e08a8df372ef1be376587e5bc206c740e5ef.tar.bz2 rails-bcf0e08a8df372ef1be376587e5bc206c740e5ef.zip |
Merge pull request #9220 from robertomiranda/where-with-empty-hash
Active Record: Change behaviour with empty hash in where clause
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/relation/where_test.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/activerecord/test/cases/relation/where_test.rb b/activerecord/test/cases/relation/where_test.rb index 53cdf89b1f..8c8f4267a9 100644 --- a/activerecord/test/cases/relation/where_test.rb +++ b/activerecord/test/cases/relation/where_test.rb @@ -92,7 +92,9 @@ module ActiveRecord end def test_where_with_table_name_and_empty_hash - assert_equal 0, Post.where(:posts => {}).count + assert_raises(ArgumentError) do + Post.where(:posts => {}) + end end def test_where_with_table_name_and_empty_array @@ -100,7 +102,9 @@ module ActiveRecord end def test_where_with_empty_hash_and_no_foreign_key - assert_equal 0, Edge.where(:sink => {}).count + assert_raises(ArgumentError) do + Edge.where(:sink => {}).count + end end def test_where_with_blank_conditions |