Sunday, March 11, 2007

Rails Fixtures not working as advertised

I'm on Rails 1.2.2 and according to the rDocs if I have loaded a fixture called books I should be able to access a hash called @books. Like this:
class BookTest < Test::Unit::TestCase

fixtures :books

def test_alternate_fixture_access
assert_equal 'War and Peace', @books['war_and_peace'].title
end

end

Line 132 of fixtures.rb tells me that I can do this. I guess this is

1 comment:

Gene Tani said...

this seems fairly persistent

http://www.railsdiary.com/diary/fixtures_hash_missing