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. Thanks! --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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. The series starts here: http://www.nullislove.com/2007/11/10/testing-in-rails-introduction/ HTH, Kevin Skoglund --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---