Thinking on hiring me?

Please read

Fernando Guillén

a Freelance Web Developer

cabecera decorativa

software development as an artistic expression

Ruby on Rails, no se me está inicializando el estado de las tablas al ejecutar un test

Estaba yo haciendo unos testecitos y veo que no se me estaban borrando los datos de la base de datos al ejecutar cada test lo cual me estaba generando unos poltergeist horribles.

Un comportamiento de Rails en el que confiaba como era este: “La base de datos vuelve al estado original en cada test“, me estaba traicionando.

Bueno el problema era que como mis tests no usaban fixturas no las estaba cargando y resulta que es la carga de las fixturas lo que borra la bd y no la propia suite de tests.

Solución:

fixtures :mimodelos

Aunque no use las fixturas es lo que he tenido que hacer para que la tabla se borrase con cada test.

¡Qué cosas!

3 Comments to “Ruby on Rails, no se me está inicializando el estado de las tablas al ejecutar un test”
  1. Barb Says:

    Hey there! I could have sworn I’ve been to this website
    before but after reading through some of the post I realized it’s new to me.
    Anyhow, I’m definitely glad I found it and I’ll be book-marking and checking back often!

  2. Vegetarian Indian Food Recipes Says:

    We stumbled over here different web address and
    thought I may as well check things out. I like what I
    see so now i’m following you. Look forward to checking out your
    web page for a second time.

    My site … Vegetarian Indian Food Recipes

  3. Wesley Says:

    I pay a visit everyday a few web sites and blogs to read content, however this website presents feature based content.

Leave a comment

You must be logged in to post a comment.

a Freelance Web Developer is proudly powered by WordPress
Entries (RSS) and Comments (RSS).

Creative Commons License
Fernando Guillen's blog by Fernando Guillen is licensed under a Creative Commons Attribution-NoDerivs 3.0 Unported License.