Fixture question


#1

Ok, I’m pretty sure I’ve seen this done before. I have a fixture that
isn’t named the same as the table I want to insert the stuff into.
Whats the right way to go about this?!

Google has failed me! :frowning:

-Nick


#2

Nick S. wrote:

Ok, I’m pretty sure I’ve seen this done before. I have a fixture that
isn’t named the same as the table I want to insert the stuff into.
Whats the right way to go about this?!

Unless you’re doing wizardly fixture sharing the simplest thing would be
to rename the yml file. Otherwise you need to embed ruby snippets into
the
fixtures, same as you do for rhtml files in your views

zsombor


#3

Could of sworn I saw this somewhere, maybe I’m wrong. The reason I ask
is for testing STI, and having the different classes be allowed to use
different fixtures…meh, guess I’ll stick em all in one file then.

Thanks anyways!
-Nick


#4

That looks like what I ran across last time! Thanks Tony!

-Nick


#5

Have a look at:
http://wiki.rubyonrails.com/rails/pages/FlexibleFixtures
Sounds like what you are after.
Knew I’d seen it somewhere as well :slight_smile:
Cheers,
Tony