New to Ruby and to Rails (but not to development or testing). Perhaps
I'm going about this wrong, but I'm writing a functional test of my
controller. The controller makes changes to the item being operated
on and saves those changes to the database. My test code doesn't
detect these changes unless I reload from the database, e.g.:
foo = foos(:my_test_foo)
post :update, :id => foo.id, :bar => "Some Data"
assert_equal("Some Data",foo.bar) # FAILS
foo = Foo.find(foo.id)
assert_equal("Some Data",foo.bar) # PASSES
I don't necessarily have a problem with this, but it made me wonder if
I'm approaching testing the wrong way. Am I?