spec/spec_helper.rb in dm-rspec-0.1.2 vs spec/spec_helper.rb in dm-rspec-0.2.0
- old
+ new
@@ -89,9 +89,20 @@
property :id, Serial
belongs_to :tag
belongs_to :book
end
+# To test validates_presence_of
+class Person
+ include DataMapper::Resource
+ property :id, Serial
+ property :first_name, String
+ property :last_name , String
+ property :age , Integer
+ validates_presence_of :first_name, :message => 'Where is the first name?'
+ validates_presence_of :last_name
+end
+
class Foreword
include DataMapper::Resource
property :id, Serial
end