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.:

def test_something
  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
end

I don't necessarily have a problem with this, but it made me wonder if
I'm approaching testing the wrong way.  Am I?

Dave

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to