Type error in unit test

Hi,

I ve got a really strange issue with one of my test unit files…

When I run that test unit I get a Type Error:
test_planned_records_with_done_records(RindTod):
TypeError: {:rind=>#<Rind:0x4bdcfc8 @unsaved=false,
@rind_daten=[#<RindBrunst:0x
4f80300 @first_planungsdatum_change=false,
@attributes={“test_ergebnis_id”=>“2”,
“updated_at”=>“2008-01-09 22:22:28”, “planungsdatum”=>“2009-05-19”,
“gewicht”=>
nil, “todes_art_id”=>nil, “rind_mehrling_anzahl_id”=>nil,
“planungsregel_id”=>"3
", “rind_id”=>“6”, “hinten_links”=>“1”, “vorne_links”=>“1”,
“start_laktzyklus”=>
nil, “land_id”=>nil, “lock_version”=>“0”, “bemerkung”=>nil,
“kurzinfo”=>“Ergebni
s: Unbekannt”, “datum”=>nil, “type”=>"Rind
./test/unit/rind_tod_test.rb:53:in new' ./test/unit/rind_tod_test.rb:53:intest_planned_records_with_done_records’

I ve got absolutely no idea why that error is happening.

Maybe anybody has an idea what might be the reason?

Thanks a lot.


Volker

Can you show us the code around line 53 in this file please:
./test/unit/rind_tod_test.rb

On Jan 10, 2008 7:58 AM, [email protected]
[email protected]
wrote:

@attributes={“test_ergebnis_id”=>“2”,
./test/unit/rind_tod_test.rb:53:in


Ryan B.
http://www.frozenplague.net
Feel free to add me to MSN and/or GTalk as this email.

Sorry, it took so long to answer…

@my_cattle = Cattle.find_by_name(“lisa”)
my_tod = CattleDeath.new(:planungsdatum => Date.today + 20,
:datum => Date.today + 20,
:todes_art =>
TodesArt.find_by_hit_code_nr(1),
:rind => @my_rind)
my_tod.save!

Error is happening in CattleDeath.new()

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs