Browse files

Stop featuring ActiveSupport::TestCase.use_instantiated_fixtures and …

…ActiveSupport::TestCase.use_transactional_fixtures as likely-to-change settings in test/test_helper.rb -- they are not and their values are already set in test_help.rb [DHH]
  • Loading branch information...
1 parent 437df4a commit d7d917335e242f48fae31bc99e6d4ab381244913 @dhh dhh committed Jan 4, 2010
Showing with 0 additions and 25 deletions.
  1. +0 −25 railties/lib/rails/generators/rails/app/templates/test/test_helper.rb
@@ -3,31 +3,6 @@
require 'rails/test_help'
class ActiveSupport::TestCase
- # Transactional fixtures accelerate your tests by wrapping each test method
- # in a transaction that's rolled back on completion. This ensures that the
- # test database remains unchanged so your fixtures don't have to be reloaded
- # between every test method. Fewer database queries means faster tests.
- #
- # Read Mike Clark's excellent walkthrough at
- #
- #
- # Every Active Record database supports transactions except MyISAM tables
- # in MySQL. Turn off transactional fixtures in this case; however, if you
- # don't care one way or the other, switching from MyISAM to InnoDB tables
- # is recommended.
- #
- # The only drawback to using transactional fixtures is when you actually
- # need to test transactions. Since your test is bracketed by a transaction,
- # any transactions started in your code will be automatically rolled back.
- self.use_transactional_fixtures = true
- # Instantiated fixtures are slow, but give you @david where otherwise you
- # would need people(:david). If you don't want to migrate your existing
- # test cases which use the @david style and don't mind the speed hit (each
- # instantiated fixtures translates to a database query per test method),
- # then set this back to true.
- self.use_instantiated_fixtures = false
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
# Note: You'll currently still have to declare fixtures explicitly in integration tests

1 comment on commit d7d9173


The default values for use_instantiated_fixtures and use_transactional_fixtures as defined in AR::Fixtures are the opposite of what was here previously.

Assuming that most apps are using the settings from this template, I'm thinking the defaults should be reversed.

Please sign in to comment.