mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-23 06:16:44 +00:00
Helper method spec
This commit is contained in:
parent
1faf0efa4b
commit
969edfcb83
@ -13,9 +13,18 @@ describe ValidatesTimeliness, 'HelperMethods' do
|
||||
Person.new.should respond_to(:validates_datetime)
|
||||
end
|
||||
|
||||
it 'should validate instance when validation method called' do
|
||||
it 'should validate instance using class validation defined' do
|
||||
Person.validates_date :birth_date
|
||||
r = Person.new
|
||||
r.valid?
|
||||
|
||||
r.errors[:birth_date].should_not be_empty
|
||||
end
|
||||
|
||||
it 'should validate instance using instance valiation method' do
|
||||
r = Person.new
|
||||
r.validates_date :birth_date
|
||||
|
||||
r.errors[:birth_date].should_not be_empty
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user