[rspec-devel] Rspec blowing away my initial data
Pat Maddox
pergesu at gmail.com
Fri Jun 6 17:13:23 EDT 2008
You could change the tasks to use db:migrate instead of dropping the db.
Pat
On Fri, Jun 6, 2008 at 2:02 PM, Yi Wen <hayafirst at gmail.com> wrote:
> Yes, it is exactly my situation. All I can do is to write a rake task
> on my own to run all specs without destroying the db first (instead,
> do rake db:migrate:reset)
>
> On Fri, Jun 6, 2008 at 3:45 PM, weexpectedthis <weexpectedthis at gmail.com> wrote:
>>
>> Fixtures are evil, at least in my opinion. And this isn't data I want loaded
>> in each test, it's data that is basically storing constants in my database.
>> I need this to be in the migration, but I don't want to have to enter the
>> data in the migration and in a fixture as well.
>>
>> -Kyle
>>
>>
>> Maurício Linhares-3 wrote:
>>>
>>> This isn't an rspec feature, every time you run your rails app tests
>>> it will drop the whole database and rebuild it again (based on the
>>> development database) but only the structure will be copied, no data
>>> will be copied and no migrations are run.
>>>
>>> If you want to add test data to your specs you should use fixtures
>>> instead or just add your data in a "before" block and remove it in an
>>> "after" block.
>>>
>>
>> --
>> View this message in context: http://www.nabble.com/Rspec-blowing-away-my-initial-data-tp17697155p17700821.html
>> Sent from the rspec-devel mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> rspec-devel mailing list
>> rspec-devel at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/rspec-devel
> _______________________________________________
> rspec-devel mailing list
> rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel
>
More information about the rspec-devel
mailing list