Reload data inside a test?


I something like:

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

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