Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

don't alter global state in test

  • Loading branch information...
commit 1c783c6040afd9a7ce0199e042e5c6549d0539b4 1 parent 4e38082
@jonleighton jonleighton authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 activerecord/test/cases/attribute_methods_test.rb
View
5 activerecord/test/cases/attribute_methods_test.rb
@@ -54,8 +54,9 @@ def test_attribute_present_with_booleans
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
Please sign in to comment.
Something went wrong with that request. Please try again.