I have some fixtures set up to put a few records in some of my tables.
In some of my rspec describe blocks, i'm *not* calling the fixtures, and
expecting the tables to be empty. But they're not - the fixture data is
in there.
Am i using fixtures wrongly? I thought that the db was wiped at the
start of every test and the fixtures were only added if asked for. Is
that not the case? I'm new to rspec and can't find much about fixtures
in the documentation.
Are you by any chance running this with a Sqlite db? I am running into
the same problem and I vaguely remember that Sqlite does not support
transactions. Which is set in my spec_helper.rb. Perhaps that throws
Rspec off.
I have some fixtures set up to put a few records in some of my tables.
In some of my rspec describe blocks, i'm *not* calling the fixtures, and
expecting the tables to be empty. But they're not - the fixture data is
in there.
Am i using fixtures wrongly? I thought that the db was wiped at the
start of every test and the fixtures were only added if asked for. Is
that not the case? I'm new to rspec and can't find much about fixtures
in the documentation.
RSpec just wraps Rails testing infrastructure, so you should see the
same behaviour in rspec or test/unit.
David Chelimsky wrote:
>>
>> I have some fixtures set up to put a few records in some of my tables.
>> In some of my rspec describe blocks, i'm *not* calling the fixtures, and
>> expecting the tables to be empty. But they're not - the fixture data is
>> in there.
>>
>> Am i using fixtures wrongly? I thought that the db was wiped at the
>> start of every test and the fixtures were only added if asked for. Is
>> that not the case? I'm new to rspec and can't find much about fixtures
>> in the documentation.
>
> RSpec just wraps Rails testing infrastructure, so you should see the
> same behaviour in rspec or test/unit.
Hi David
You actually answered this question in another mailing list a while ago
Ah - difficult to keep track of who is who sometimes! Glad you got it resolved.