diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-09-05 10:06:49 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-09-05 10:06:49 +0000 |
commit | 9315992d4032a5eeb5660f1810059d263bee949c (patch) | |
tree | 3476bd4ec526b6efb1d4981b6f0eaa7275a045a3 | |
parent | 2928a3aeeb400ae4a829b7ec99e5837691450288 (diff) | |
download | redmine-9315992d4032a5eeb5660f1810059d263bee949c.tar.gz redmine-9315992d4032a5eeb5660f1810059d263bee949c.zip |
Adds test_helper.rb template to the plugin generator.
git-svn-id: http://redmine.rubyforge.org/svn/branches/work@1784 e93f8b46-1217-0410-a6f0-8f06a7374b81
4 files changed, 9 insertions, 2 deletions
diff --git a/hooks/lib/generators/redmine_plugin/redmine_plugin_generator.rb b/hooks/lib/generators/redmine_plugin/redmine_plugin_generator.rb index 2a7319f7b..666386abd 100644 --- a/hooks/lib/generators/redmine_plugin/redmine_plugin_generator.rb +++ b/hooks/lib/generators/redmine_plugin/redmine_plugin_generator.rb @@ -20,10 +20,12 @@ class RedminePluginGenerator < Rails::Generator::NamedBase m.directory "#{plugin_path}/assets/javascripts" m.directory "#{plugin_path}/assets/stylesheets" m.directory "#{plugin_path}/lang" + m.directory "#{plugin_path}/test" m.template 'README', "#{plugin_path}/README" m.template 'init.rb', "#{plugin_path}/init.rb" m.template 'en.yml', "#{plugin_path}/lang/en.yml" + m.template 'test_helper.rb', "#{plugin_path}/test/test_helper.rb" end end end diff --git a/hooks/lib/generators/redmine_plugin/templates/test_helper.rb b/hooks/lib/generators/redmine_plugin/templates/test_helper.rb new file mode 100644 index 000000000..bd1ed0c5d --- /dev/null +++ b/hooks/lib/generators/redmine_plugin/templates/test_helper.rb @@ -0,0 +1,5 @@ +# Load the normal Rails helper +require File.expand_path(File.dirname(__FILE__) + '/../../../../test/test_helper') + +# Ensure that we are using the temporary fixture path +Engines::Testing.set_fixture_path diff --git a/hooks/lib/generators/redmine_plugin_controller/templates/functional_test.rb b/hooks/lib/generators/redmine_plugin_controller/templates/functional_test.rb index 38e0ae712..876bd79e2 100644 --- a/hooks/lib/generators/redmine_plugin_controller/templates/functional_test.rb +++ b/hooks/lib/generators/redmine_plugin_controller/templates/functional_test.rb @@ -1,4 +1,4 @@ -require 'test_helper' +require File.dirname(__FILE__) + '/../test_helper' class <%= class_name %>ControllerTest < ActionController::TestCase # Replace this with your real tests. diff --git a/hooks/lib/generators/redmine_plugin_model/templates/unit_test.rb b/hooks/lib/generators/redmine_plugin_model/templates/unit_test.rb index b464de47a..cc8b2e591 100644 --- a/hooks/lib/generators/redmine_plugin_model/templates/unit_test.rb +++ b/hooks/lib/generators/redmine_plugin_model/templates/unit_test.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../test_helper' +require File.dirname(__FILE__) + '/../test_helper' class <%= class_name %>Test < Test::Unit::TestCase fixtures :<%= table_name %> |