test_helper.rb 724 B

1234567891011121314151617181920212223
  1. # Load the normal Rails helper
  2. require File.expand_path(File.dirname(__FILE__) + '/../../../test/test_helper')
  3. module Redmine
  4. module PluginFixturesLoader
  5. def self.included(base)
  6. base.class_eval do
  7. def self.plugin_fixtures(*symbols)
  8. ActiveRecord::Fixtures.create_fixtures(File.dirname(__FILE__) + '/fixtures/', symbols)
  9. end
  10. end
  11. end
  12. end
  13. end
  14. unless ActionController::TestCase.included_modules.include?(Redmine::PluginFixturesLoader)
  15. ActionController::TestCase.send :include, Redmine::PluginFixturesLoader
  16. end
  17. unless ActiveSupport::TestCase.included_modules.include?(Redmine::PluginFixturesLoader)
  18. ActiveSupport::TestCase.send :include, Redmine::PluginFixturesLoader
  19. end