2009/8/1 karthik k <[email protected]>:
> def test_check_for_validity
>     post=County.new(:name=>"myname",:description=>"mydesc")
>     assert post.save
>   end
>
> above is the method and when i run unit test it is saying as
>
> 1) Failure:
> test_check_for_validity(CountyTest) [/test/unit/county_test.rb:10]:
> <false> is not true.
>
> what does it say i cannot under stand
>

It is saying that the post.save failed (the assert is expecting true,
so false makes the test fail).  Possibly your validations are failing.
 If you put the line

assert post.valid?, post.errors.full_messages

before the save this will check the item for validity before
attempting to save it and show you any errors from validations (I
think).

Colin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to