Vita Rara: A Life Uncommon

Shoulda: should_validate_uniqueness_of


Categories: | | |

When testing an ActiveRecord model that validates_uniqueness_of using Shoulda's should_validate_uniqueness_of macro it needs to be wrapped in a context where an instance of the model is created in the database. If there is no record in the database to validate against you'll get an error.

For more information see: Lighthouse Ticket.