[LRUG] Test does not load many to many fixture

Graham Ashton graham at effectif.com
Wed Feb 10 04:44:38 PST 2010


On 10 Feb 2010, at 11:30, Riccardo Tacconi wrote:

> Do I have to specify somewhere how to load this fixture?

As I recall (it's been a very long time since I've used fixtures) you need to mention which fixtures to use in your test case. I just checked the Rails guide on the subject though [1] which claims that Rails will load all fixtures by default. This suggests that my memory is failing. Loading everything seems a bit daft; it could take ages.

Have you tried adding something like this to the top of your test case?

  fixtures :roles, :users, :roles_users

Alternatively, try factory_girl or blueprint, which are much less pain to work with.

[1] http://guides.rubyonrails.org/testing.html#the-low-down-on-fixtures


More information about the Chat mailing list