I am using validates_existence_of in some of my Model classes. For instance I have the following class:
class User < ActiveRecord::Base
If I create an instance of User in the console and set the department to be one that does not exist in the db, then a call to valid? returns false.
However, if I create a rspec test block, that does something similar, then valid? returns true. It is almost as if rspec is ignoring the validates_existence_of. Does naybody have any ideas how to fix this?
Thanks in advance