I’m using the Shoulda gem. I’m using the validate_presence_of
method. It is working nicely. It doesn’t seem to work, however, when using a strict validation. Example:
class Thing < ActiveRecord::Base
validates :status, presence: true # works
validates :status, presence: true, strict: true # does not work
end
describe Thing do
let(:thing) { FactoryGirl.build_stubbed :thing }
subject { thing }
it { should validate_presence_of :status }
end
Any idea how I can make it work? Maybe strict validations just aren’t supported? I can’t seem to find information about this in the repository or in the docs.
I think
strict
validators are tested like this: