diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-11-30 23:47:10 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-11-30 23:47:16 +0000 |
commit | 1c783c6040afd9a7ce0199e042e5c6549d0539b4 (patch) | |
tree | 36f5b0cd69282b5ecd0c3274fb9e0cdfda024541 /activerecord | |
parent | 4e380828ffa8279740256164c6b83148cf0cbf13 (diff) | |
download | rails-1c783c6040afd9a7ce0199e042e5c6549d0539b4.tar.gz rails-1c783c6040afd9a7ce0199e042e5c6549d0539b4.tar.bz2 rails-1c783c6040afd9a7ce0199e042e5c6549d0539b4.zip |
don't alter global state in test
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/attribute_methods_test.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb index 7c9383b194..17cf1ec907 100644 --- a/activerecord/test/cases/attribute_methods_test.rb +++ b/activerecord/test/cases/attribute_methods_test.rb @@ -54,8 +54,9 @@ class AttributeMethodsTest < ActiveRecord::TestCase end def test_caching_nil_primary_key - Minimalistic.expects(:reset_primary_key).returns(nil).once - Minimalistic.create! + klass = Class.new(Minimalistic) + klass.expects(:reset_primary_key).returns(nil).once + 2.times { klass.primary_key } end def test_attribute_keys_on_new_instance |