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?
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)
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.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.