I have a Rails 2.2 app that I'm supporting and one thing that needs to be done before the app start is a small rake task to initialize and make sure the database is properly set. How can I get this task run right after rspec initializes the database. I run rspec using the rails spec command.
+1
A:
You could put a simple system call to your spec_helper.rb
file.
An Example could look like this
# run rake task
`rake your_task RAILS_ENV=test`
RSpec.configure do |config|
...
end
Max Schulze
2010-10-25 22:17:54
Tried it but still no luck, I figured out the initializers I have are the issue, I'm trying out preinitializer.rb in the config folder
nkassis
2010-10-28 18:40:25
I mean this normally works for me, you can also put it into an initializer and have it run upon each load of the test environment.
Max Schulze
2010-10-29 02:55:14