mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-25 07:16:41 +00:00
Helper method spec
This commit is contained in:
@@ -13,9 +13,18 @@ describe ValidatesTimeliness, 'HelperMethods' do
|
|||||||
Person.new.should respond_to(:validates_datetime)
|
Person.new.should respond_to(:validates_datetime)
|
||||||
end
|
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 = Person.new
|
||||||
r.validates_date :birth_date
|
r.validates_date :birth_date
|
||||||
|
|
||||||
r.errors[:birth_date].should_not be_empty
|
r.errors[:birth_date].should_not be_empty
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user