search for: initial_object

Displaying 1 result from an estimated 1 matches for "initial_object".

2011 Apr 08
1
[rspec-rails] reload of objects in tests
hi, I am kind of confused, why this code is behaving the way it does. In a test, I wrote something like this: it "should do something" do @some = Factory(:some) initial_object = @some #do something with @some. e.g. update attributes etc. @some.reload @some.should_not == initial_object end Whenever I call reload on the object, the initial_object is set to object again. I don''t understand why a reload on @some is also updating initial_object. Can someone...