Basis of rails-driven app for local business
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

38 lines
1.8 KiB

  1. ENV["RAILS_ENV"] = "test"
  2. require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
  3. require 'test_help'
  4. class Test::Unit::TestCase
  5. # Transactional fixtures accelerate your tests by wrapping each test method
  6. # in a transaction that's rolled back on completion. This ensures that the
  7. # test database remains unchanged so your fixtures don't have to be reloaded
  8. # between every test method. Fewer database queries means faster tests.
  9. #
  10. # Read Mike Clark's excellent walkthrough at
  11. # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
  12. #
  13. # Every Active Record database supports transactions except MyISAM tables
  14. # in MySQL. Turn off transactional fixtures in this case; however, if you
  15. # don't care one way or the other, switching from MyISAM to InnoDB tables
  16. # is recommended.
  17. #
  18. # The only drawback to using transactional fixtures is when you actually
  19. # need to test transactions. Since your test is bracketed by a transaction,
  20. # any transactions started in your code will be automatically rolled back.
  21. self.use_transactional_fixtures = true
  22. # Instantiated fixtures are slow, but give you @david where otherwise you
  23. # would need people(:david). If you don't want to migrate your existing
  24. # test cases which use the @david style and don't mind the speed hit (each
  25. # instantiated fixtures translates to a database query per test method),
  26. # then set this back to true.
  27. self.use_instantiated_fixtures = false
  28. # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
  29. #
  30. # Note: You'll currently still have to declare fixtures explicitly in integration tests
  31. # -- they do not yet inherit this setting
  32. fixtures :all
  33. # Add more helper methods to be used by all tests here...
  34. end