Hi all I am testing my model. My model has validates presence of and a validate function that assumes that there is something in a variable that I have based on the aect that it has validates its presence. when I call valid? on a nil object the function fails because it tries to call this validate without checking to see if something is there , is there anyway to stop validate from being called? White Wizzard --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
White Wizzard wrote:> Hi all > > I am testing my model. My model has validates presence of and a > validate function that assumes that there is something in a variable > that I have based on the aect that it has validates its presence. > when I call valid? on a nil object the function fails because it tries > to call this validate without checking to see if something is there , > is there anyway to stop validate from being called? > > > White WizzardUse RSpec :D -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---