Search code examples
ruby-on-railsrubyfixtures

rails, tests, and fixtures - Error "underlying cause no such file to load"


I'm trying to get the tests for my rails app to run, but it keeps giving me the following errors:

Unable to load tp_approval_step, underlying cause no such file to load -- tp_approval_step

I have a fixture named tp_approval_step.yml and I have also added this to my test_helper.rb

set_fixture_class :tp_approval_step => ApprovalProcessStep

I am receiving these errors for all of my fixtures. Any ideas about what I can do to eliminate these errors?

Thanks


Solution

  • Long story short - after browsing and asking on rubyonrails-talk - almost nobody uses or cares about fixtures. The prevailing wisdom in the community is to use a factory class to load the database. There are libraries that can help with this, in particular, factory_girl and machinist.