I am creating some unit test for class methods which create/update
records in one or more tables.
What is the best way to check that this is done and assert the
results?
I would expect something like an unordered array of hashes compare
(with what I think should be in the db with what is in the db), but
before I build this myself is there something about this already
done? I've googled everywhere but all I find are validation test
examples.
I am (admittedly slowly) posting a multi-part tutorial on testing.
I'm hoping not just to make testing easy and less intimidating to
beginners, but also to examine what to test and how to write
meaningful tests.
I will be writing about unit testing ActiveRecord models next. (Maybe
by early next week?) It may answer your questions.