aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2012-04-13 12:15:43 +0100
committerJon Leighton <j@jonathanleighton.com>2012-04-13 13:17:42 +0100
commitf52253cbebf0124bb74925e91bcca75325eaa502 (patch)
treed75f134d4d46240a8258951bf30c9f188d0cf6c3 /activerecord/test
parent0183193a6aecefb3b55a5abf20792aee6b57dcc1 (diff)
downloadrails-f52253cbebf0124bb74925e91bcca75325eaa502.tar.gz
rails-f52253cbebf0124bb74925e91bcca75325eaa502.tar.bz2
rails-f52253cbebf0124bb74925e91bcca75325eaa502.zip
assert valid keys
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/relation_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/relation_test.rb b/activerecord/test/cases/relation_test.rb
index a38255eda6..31236cae15 100644
--- a/activerecord/test/cases/relation_test.rb
+++ b/activerecord/test/cases/relation_test.rb
@@ -145,6 +145,10 @@ module ActiveRecord
test 'merging an empty hash into a relation' do
assert_equal [], Relation.new(:a, :b).merge({}).where_values
end
+
+ test 'merging a hash with unknown keys raises' do
+ assert_raises(ArgumentError) { Relation::HashMerger.new(nil, omg: 'lol') }
+ end
end
class RelationMutationTest < ActiveSupport::TestCase