Forum: Ruby on Rails Fixture access question

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Tony Ketteringham (Guest)
on 2006-02-08 05:52
(Received via mailing list)
I want to add the basic model record create tests for my rails app
as in the "Agile Web D. with Rails" example:
i.e. (header stuff and boring repitition missed)

def test_create
  assert_kind_of Requirement, requirements(:requirement_1)
  assert_equal <at>requirements["requirement_1"]["name"],

Now I'm not supposed to use <at>requirements since that's slow but
how do I now "get" to the Fixture values, as opposed to the
Requirement class object created from those values?
I thought that requirements(:requirement_1)["created_on"]
would be the go but it worries me that:
requirements(:requirement_1).class is "Requirement"
and (when I turn it back on)
@requirements["requirement_1"].class is "Fixture"

This is probably post Java programming paranoia but I'd
hate to write a bunch of tests validating that a=a :-)
I've had a read of the fixtures questions on the rails list, had a read
the HowtoUnitTest, read MikeClark's Weblog but no-one seems
to do exactly this. I'm afraid my Ruby isn't yet up to working this out
fixtures.rb (though I've had an interesting read)
Thanks in advance for any help.
This topic is locked and can not be replied to.