# Tests

**URL:** <https://www.ruby-forum.com/t/tests/116953>\
**Category:** Rails\
**Created:** [October 11, 2007, 4:42pm UTC](https://www.ruby-forum.com/t/tests/116953 "2007-10-11T16:42:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![whitewolfaustria](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/bbce88/32.png) [@whitewolfaustria](https://www.ruby-forum.com/u/whitewolfaustria)\
**Post date:** [October 11, 2007, 4:42pm UTC](https://www.ruby-forum.com/t/tests/116953/1 "2007-10-11T16:42:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![whitewolfaustria](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/bbce88/32.png) [@whitewolfaustria](https://www.ruby-forum.com/u/whitewolfaustria)\
**Post date:** [October 11, 2007, 8:12pm UTC](https://www.ruby-forum.com/t/tests/116953/2 "2007-10-11T20:12:08Z")

</div>

White W. 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 W.

Use RSpec 😃
