mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-22 22:06:45 +00:00
instance validation spec
This commit is contained in:
parent
712c1dd603
commit
1bc579f861
@ -13,6 +13,12 @@ describe ValidatesTimeliness::HelperMethods do
|
|||||||
ActiveRecord::Base.instance_methods.should include('validates_datetime')
|
ActiveRecord::Base.instance_methods.should include('validates_datetime')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'should validate instance when validation method called' do
|
||||||
|
r = Employee.new
|
||||||
|
r.validates_date :birth_date
|
||||||
|
r.errors[:birth_date].should_not be_empty
|
||||||
|
end
|
||||||
|
|
||||||
describe ".timeliness_validated_attributes" do
|
describe ".timeliness_validated_attributes" do
|
||||||
it 'should return attributes validated with plugin validator' do
|
it 'should return attributes validated with plugin validator' do
|
||||||
Person.validates_date :birth_date
|
Person.validates_date :birth_date
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user