Posts [ 3 ]

Topic: Performance tests with Ruby-Prof and fixture questions

I am using some articles I found on using ruby-prof and functional tests. My goal is to work out my application and find areas to improve performance.However, I am not terribly familiar with rails testing and fixtures. What I expect to be happening is not happening.

In my case I expect that the data in my users.yml fixture will be inserted into the database and be available to User.find(:xyz) methods. However, my assertion always fails because the User.find_by_remember_token("test_remember_token") always returns nil. So I assume that means my fixture data is never making it into the database, which I thought the 'fixtures: users' statement should do.

Re: Performance tests with Ruby-Prof and fixture questions

Did you ever figure this out? I seem to see similar behavior right now.

Additionally, if I use the access method for the fixtures ( users(:dave) in your case ) I get an error message: undefined method '[]' for nil:NilClass which occurs in fixtures.rb:882.

When I look at the code for ruby_prof/test.rb it appears to try and call setup during run_test. However, if I add a little debug to fixtures.rb I find that setup_fixtures is never getting called (this initilizes @fixture_cache my nil error above).