Forum: Ruby on Rails Re: PostgreSQL 8.1, testing with constraints

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 drbrain (Guest)
on 2005-11-30 20:17
(Received via mailing list)
On Nov 30, 2005, at 10:40 AM, rails-request@lists.rubyonrails.org wrote:

> without the foreign key constraints, they run fine, but blow up when I
> active_record/connection_adapters/abstract_adapter.rb:67:in
> `log': ERROR:  relation "users" already exists
> (ActiveRecord::StatementInvalid)
>
> I assume that it's not able to drop the users table because of a
> foreign key constraint in the messages table.  I'm not using the
> messages fixture in these unit tests though, so it shouldn't matter.
>
> I want to use foreign key constraints in my database, but I also want
> to be able to unit test my code.  What am I missing here?

http://dev.rubyonrails.org/ticket/2404

--
Eric Hodel - drbrain@segment7.net - http://segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com
42172acdf3c6046f84d644cb0b94642c?d=identicon&s=25 Pat Maddox (pergesu)
on 2005-11-30 20:29
(Received via mailing list)
I actually figured out the answer to this problem, it was because of a
custom test_helper.rb file in the LoginEngine.  However as I mentioned
in a reply, one of my unit tests is complaining about a fixture that
shouldn't even be loaded in that particular file.  I only specify the
users and the tickets fixtures, but it complains that some record in
the messages table references a user record.  There shouldn't be any
messages records though, so I'm just confused.
24d2f8804e6bb4b7ea6bd11e0a586470?d=identicon&s=25 jeremy (Guest)
on 2005-11-30 20:37
(Received via mailing list)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Nov 30, 2005, at 11:25 AM, Pat Maddox wrote:
> I only specify the
> users and the tickets fixtures, but it complains that some record in
> the messages table references a user record.  There shouldn't be any
> messages records though, so I'm just confused.

This is the same issue covered in ticket #2404 which Eric linked to.

jeremy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)

iD8DBQFDjf7pAQHALep9HFYRAsvAAJ9x098LIJXK4B5JCl4NmbzMMSuKYACeKISW
VVXLCWDuMdeqBeF+9jrrKws=
=k5CY
-----END PGP SIGNATURE-----
This topic is locked and can not be replied to.