Shoulda keeps changing the table to run all tests against

0 views
Skip to first unread message

secureboot

unread,
Aug 29, 2010, 12:18:27 AM8/29/10
to shoulda
I'm using shoulda (2.11.3) and rails 3.0.0.rc2.

When I add new models, all my shoulda tests try to run all inserts on
the new table.

To elaborate: let's say I create a new model post. My user tests all
start failing, with:

table users has no column named post_name: INSERT INTO "posts"

Not sure why this could be happening - what info do I need to gather
to figure this out? Is this a known issue that I missed?

I'm new-ish to shoulda, so I could be messing something up here, but
it all seems pretty straightforward (and odd that old, established,
working tests break).

Cynthia Kiser

unread,
Aug 29, 2010, 12:16:35 PM8/29/10
to sho...@googlegroups.com
Quoting secureboot <secur...@gmail.com>:
> I'm using shoulda (2.11.3) and rails 3.0.0.rc2.
>
> When I add new models, all my shoulda tests try to run all inserts on
> the new table.
>
> To elaborate: let's say I create a new model post. My user tests all
> start failing, with:
>
> table users has no column named post_name: INSERT INTO "posts"

I think your test database is out of sync with your models. Try
running db:migrate on test:

RAILS_ENV=test rake db:migrate

If that doesn't work, try dropping, recreating, and remigrating your
test db.

--
Cynthia Kiser
c...@caltech.edu

secureboot

unread,
Aug 29, 2010, 3:11:23 PM8/29/10
to shoulda
The answer is that the fixtures that get generated for new models in
3.0.0.rc2 screw up shoulda. Deleting the fixtures files fixes the
problem.

I'd imagine that'll impact some other folks down the line, so I wanted
to mention the solution at least somewhere.

On Aug 29, 9:16 am, Cynthia Kiser <c...@caltech.edu> wrote:
Reply all
Reply to author
Forward
0 new messages