← Back to Upcase

Rspec and date testing problem

(Jon Seidel) #1

Is there something special about Rspec handling for date fields?

I set a required date field (validates_presence_of) to nil, say "a.should_not be_valid’ and yet the spec passes. When I display the record, that date field clearly has nil.

(Ben Orenstein) #2

That’s odd. I would definitely expect a validation error in that instance.

Can you post a link to a gist of your code and the console output that shows it failing?


(Jon Seidel) #3

I’ll see if I can recreate, but I’ve changed a bunch of stuff and things all seem to be working now.

(Ben Orenstein) #4

Ah, the ol’ “change lots of stuff until it’s fixed” debugging method :smile:

Glad to hear it’s working.