Topic: What is the point of fixtures?

I just went through a huge ordeal to get some of my specs running off my fixture file, only to get errors which complain that the user is not in the database.

I'm pretty green with testing, but was pretty convinced that the whole point of fixtures was to spare you a hit to the database. Am I mistaken?

Re: What is the point of fixtures?

I'm no testing expert, but I believe Rails takes fixtures and loads them into the test database before your tests run.

From http://manuals.rubyonrails.com/read/chapter/26 (site down at the moment, I used the Google cache):

"Fixtures allow you to populate your testing database with predefined data before your tests run."

Re: What is the point of fixtures?

I am certainly no expert either, but having to deal with the database in my model specs seems very counterintuitive.

Looks like I will have to bone up on mocking/stubbing.

Re: What is the point of fixtures?

This is good screencast for getting away from fixtures:

http://railscasts.com/episodes/60

I just recently got my application to pass all of my unit and functional tests. I am using fixtures, but I can see how it can get ugly and complex quickly.

Re: What is the point of fixtures?

All of a sudden, fixtures dont look too bad

http://ryandaigle.com/articles/2007/10/ … lot-easier

Re: What is the point of fixtures?

Nice, those are some of the exact problems I had with using fixtures, and they are solved. I'm going to try out the Rathole plugin since I'm not running Edge Rails.