Displaying 2 results from an estimated 2 matches for "disableforeignkeychecksundermysql".
2006 Feb 23
1
HABTM testing - fixtures not loading?
Hi,
I have a strange problem with testing classes which have a HABTM
relation. It seems that while running my tests with rake the fixture for
the association table is not loaded - as a result I get a failure on a
test which simply checks the number of associated elements - it says
it''s 0 although there should be one. The weird thing is that when I run
the tests with rcov
2006 Mar 01
1
maddening intermittent failures in unit tests with "working" code
...9;logger''
class Test::Unit::TestCase
self.use_transactional_fixtures = true
self.use_instantiated_fixtures = false
# From http://rails.techno-weenie.net/tip/2005/11/20/log_within_tests
def logger
RAILS_DEFAULT_LOGGER
end
end
# from
http://wiki.rubyonrails.com/rails/pages/DisableForeignKeyChecksUnderMySql
class Fixtures
alias :original_delete_existing_fixtures :delete_existing_fixtures
alias :original_insert_fixtures :insert_fixtures
def delete_existing_fixtures
@connection.update "SET FOREIGN_KEY_CHECKS = 0", ''Fixtures deactivate
foreign key checks.''...