From 1bc579f861c1defef99ec7296e4fc941c03e0043 Mon Sep 17 00:00:00 2001 From: Adam Meehan Date: Sat, 7 Aug 2010 19:10:36 +1000 Subject: [PATCH] instance validation spec --- spec/validates_timeliness/helper_methods_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/validates_timeliness/helper_methods_spec.rb b/spec/validates_timeliness/helper_methods_spec.rb index 87d1433..7d9af72 100644 --- a/spec/validates_timeliness/helper_methods_spec.rb +++ b/spec/validates_timeliness/helper_methods_spec.rb @@ -13,6 +13,12 @@ describe ValidatesTimeliness::HelperMethods do ActiveRecord::Base.instance_methods.should include('validates_datetime') 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 it 'should return attributes validated with plugin validator' do Person.validates_date :birth_date