To unit test the models'' functionality, I realized I need to call save. That said, I wondered if save in test causes the model to be stored in the database. If so, what should I do to avoid this problem? Should I just call Model.destroy_all at the end? Second, to test controllers'' functionality, is it possible to set the params and session hash? If not, how do you test controller functionality? Also, many of my models uses has_many and belongs_to. What''s the difference between the following methods: count, size, length. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
To unit test the models'' functionality, I realized I need to call save. That said, I wondered if save in test causes the model to be stored in the database. If so, what should I do to avoid this problem? Should I just call Model.destroy_all at the end? Second, to test controllers'' functionality, is it possible to set the params and session hash? If not, how do you test controller functionality? Also, many of my models uses has_many and belongs_to. What''s the difference between the following methods: count, size, length. --~--~---------~--~----~------------~-------~--~----~ 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 don''t know how I double-posted, but anyway...I have one more question I overlooked. I have several models created by the line "ruby script/generate model two_words". How should I program the view forms in this case? Since the controller would call this model as "TwoWords", should the form be <% form_for :twoWords, @this_variable do |form| %> ... <%end%>, or should I stick with the intentional name <% form_for :two_words, @this_variable do |form| %> ... <%end%>. In either cases, where would the params be set in this form? In params[:two_words]? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---