Sha256: 682f717f1bb45b2b0bbc817d697e262d1c3a69d76e2daefb44f6d793dc8c3ad3
Contents?: true
Size: 673 Bytes
Versions: 68
Compression:
Stored size: 673 Bytes
Contents
require 'spec_helper' describe Hydra::FutureDateValidator do let(:future_date) { Date.today + 2 } let(:past_date) { Date.today - 2 } let(:validator) { Hydra::FutureDateValidator.new(attributes: [:embargo_release_date, :lease_expiration_date]) } before do validator.validate(subject) end context "when date is valid" do subject { ModsAsset.new(embargo_release_date: future_date) } its(:errors) { should be_empty } end context "when date is invalid" do subject { ModsAsset.new(lease_expiration_date: past_date) } it "has errors" do expect(subject.errors[:lease_expiration_date]).to eq ['Must be a future date'] end end end
Version data entries
68 entries across 68 versions & 1 rubygems