Tests

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.

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 :smiley:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs