Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Helper method spec

  • Loading branch information...
commit 969edfcb8332b5e1760cde90508cd4a4412f77e2 1 parent 1faf0ef
@adzap adzap authored
Showing with 10 additions and 1 deletion.
  1. +10 −1 spec/validates_timeliness/helper_methods_spec.rb
View
11 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
Please sign in to comment.
Something went wrong with that request. Please try again.