Hi!

Im pretty new with RoR and have a problem with the Unit Test in P. Lenz Book on page 224.

This test ...
Code Ruby:
def test_votes_association
  assert_equal [ votes(:first), votes(:second) ], stories(:first).votes
end
... end in this failure:
test_votes_association(StoryTest) [./test/unit/story_test.rb:24]:
<[#<Vote:0x9a25c0c
@attributes=
{"story_id"=>"1", "id"=>"1", "created_at"=>"2007-12-29 01:19:57"}>,
#<Vote:0x9a2525c
@attributes=
{"story_id"=>"1", "id"=>"2", "created_at"=>"2007-12-29 01:19:57"}>]> expected but was
<[#<Vote:0x9a23c54 @attributes={"story_id"=>"1", "id"=>"2", "created_at"=>"2007-12-29 01:19:57"}>, #<Vote:0x9a23c2c @attributes={"story_id"=>"1", "id"=>"1", "created_at"=>"2007-12-29 01:19:57"}>]>.

When i reverse the array like this ...
Code Ruby:
def test_votes_association
  assert_equal [ votes(:second), votes(:first) ], stories(:first).votes
end
... the test end in success.

Did anyone know the reason for this?

Thank you very much!