Reload data inside a test?

Hi,

I something like:

def test_something
@object = Object.create(…)
@object.update_attribute(…)
assert_equal “changed”, @object.attribute
end

The problem is that in the assertion, @object still holds the old
values. Isn’t there a reload! method to reload the @object values?

I found out just after posting. FYI: @object.reload

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs