I’m starting to get into testing my current e-commerce Rails app before
Engine-ify it…(Codename “Substruct” - don’t sleep!)
I’ve got some data that should be loaded before each test. Convention
me that I should prepare this data in nice YML files as fixtures,
I’m not quite so sure.
The data in question is a country list (upwards of 200 items), order
codes, and shipping codes (fedex, ups, dhl, etc) amongst other things.
standard stuff that’s needed in tests and in the real production app.
I have all of the default values in a SQL file that I load for new
applications with a Rake task. I really don’t want to duplicate that
information in fixtures - especially the huge country list.
I’ve been calling that Rake task in the “setup” method - which works
sometimes. On OSX/Linux it works, in XP it breaks. I’m guessing XP
rake load_authority_data. Ideas on that? Additionally, running
rake task in setup causes my tests to run extremely sloooow.
How is everyone handling this situation in their applications? How do
load authority data in new applications vs testing? Am I doing something
really stupid here or what?
Let me know, thanks…