[Rspec-users] fixtures data persists?

aslak hellesoy aslak.hellesoy at gmail.com
Thu Oct 26 11:25:02 EDT 2006


On 10/25/06, alan maybourne <alan.maybourne at hotmail.co.uk> wrote:
> I'm not sure if this is a feature or a bug, but if I load a set of fixtures
> in one context, the data remains in the database and is available to the
> next context, even if the next context doesn't explicitly load that set of
> fixtures
>
> context "saved User objects" do
>   fixtures :users
> end
>
> context "new User objects" do
>
> end
>
> if I call User.find(1) from a spec in the 'new User objects' context, it'll
> find the object loaded in the earlier context. I'd like to disable this if
> possible. Could someone tell me how?
>

This is a Rails feature. You'd get the same behaviour with Test::Unit.

See the two "Should fixtures be transactional?" threads here:
http://rubyforge.org/pipermail/rspec-users/2006-October/thread.html

Please ask further questions about this in the Rails forum.

> thanks
> alan
>
> _________________________________________________________________
> Windows Live™ Messenger has arrived. Click here to download it for free!
> http://imagine-msn.com/messenger/launch80/?locale=en-gb
>
>
>
> _______________________________________________
> Rspec-users mailing list
> Rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
>


More information about the Rspec-users mailing list