diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2016-01-04 15:15:55 -0700 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2016-01-04 15:15:55 -0700 |
commit | c2181fbcb76d6db08b5231ba5ea8c51b80b97331 (patch) | |
tree | b099fb952df120128d046dc12487f1319ef4b765 /activerecord/test | |
parent | 9fb4efedfc6409eaf59a8a55771eecacbb9f5c71 (diff) | |
parent | 0aa5150f9fb81fc6cf9d7b7915c8d7b015e452a2 (diff) | |
download | rails-c2181fbcb76d6db08b5231ba5ea8c51b80b97331.tar.gz rails-c2181fbcb76d6db08b5231ba5ea8c51b80b97331.tar.bz2 rails-c2181fbcb76d6db08b5231ba5ea8c51b80b97331.zip |
Merge pull request #22550 from tamird/record-fetch-warning-allocate-less
activerecord: allocate fewer objects
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/relation_test.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/activerecord/test/cases/relation_test.rb b/activerecord/test/cases/relation_test.rb index 2f0382e273..03583344a8 100644 --- a/activerecord/test/cases/relation_test.rb +++ b/activerecord/test/cases/relation_test.rb @@ -43,13 +43,17 @@ module ActiveRecord (Relation::SINGLE_VALUE_METHODS - [:create_with]).each do |method| assert_nil relation.send("#{method}_value"), method.to_s end - assert_equal({}, relation.create_with_value) + value = relation.create_with_value + assert_equal({}, value) + assert_predicate value, :frozen? end def test_multi_value_initialize relation = Relation.new(FakeKlass, :b, nil) Relation::MULTI_VALUE_METHODS.each do |method| - assert_equal [], relation.send("#{method}_values"), method.to_s + values = relation.send("#{method}_values") + assert_equal [], values, method.to_s + assert_predicate values, :frozen?, method.to_s end end |