[rspec-devel] Rspec blowing away my initial data
Bryan Ray
bryansray at gmail.com
Fri Jun 6 16:49:26 EDT 2008
Just copy the code out of the migration and in to a before block?
Could probably just generate a YAML file using to_yaml as well ...
should be fairly simple. Then just drop it in your spec/fixtures
On Jun 6, 2008, at 3:45 PM, weexpectedthis 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
More information about the rspec-devel
mailing list