Permalink
Browse files

Helper method spec

  • Loading branch information...
1 parent 1faf0ef commit 969edfcb8332b5e1760cde90508cd4a4412f77e2 @adzap adzap committed Aug 6, 2011
Showing with 10 additions and 1 deletion.
  1. +10 −1 spec/validates_timeliness/helper_methods_spec.rb
@@ -13,9 +13,18 @@
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

0 comments on commit 969edfc

Please sign in to comment.