search for: test_invalid

Displaying 1 result from an estimated 1 matches for "test_invalid".

2006 Jul 11
4
assert fails with <false> is not true
Hi, I have a simple model and written a testcase. class Product < ActiveRecord::Base validates_presense_of :name end ------------- class ProductTest < Test::Unit::TestCase fixtures :products def test_invalid product = Product.new assert !product.valid? end end ------------- The testcase fails with a message, <false> is not true. What is wrong with the testcase? I can see it ruby console that "product.valid?" returns false...so "assert !product.valid?" should return...