Displaying 1 result from an estimated 1 matches for "validates_database_schema".
2006 Jun 25
0
Using the database schema to help validate data
...atch to ActiveRecord.
Index: test/validations_test.rb
===================================================================
--- test/validations_test.rb (revision 4495)
+++ test/validations_test.rb (working copy)
@@ -461,6 +461,13 @@
t.title = nil
assert t.valid?
end
+
+ def test_validates_database_schema
+ Topic.validates_database_schema
+ t = Topic.create("title" => "a" * 256, "content" => "whatever")
+
+ assert !t.valid?, "validation should have failed because the title
is too long"
+ end
def test_validates_length_of_using_max...