##// END OF EJS Templates
Fixes test templates for plugins....
Jean-Philippe Lang -
r9554:afbff44fb4c7
parent child
Show More
@@ -1,33 +1,37
1 1 class RedminePluginGenerator < Rails::Generators::NamedBase
2 2 source_root File.expand_path("../templates", __FILE__)
3 3
4 4 attr_reader :plugin_path, :plugin_name, :plugin_pretty_name
5 5
6 6 def initialize(*args)
7 7 super
8 8 @plugin_name = file_name.underscore
9 9 @plugin_pretty_name = plugin_name.titleize
10 10 @plugin_path = "plugins/#{plugin_name}"
11 11 end
12 12
13 13 def copy_templates
14 14 empty_directory "#{plugin_path}/app"
15 15 empty_directory "#{plugin_path}/app/controllers"
16 16 empty_directory "#{plugin_path}/app/helpers"
17 17 empty_directory "#{plugin_path}/app/models"
18 18 empty_directory "#{plugin_path}/app/views"
19 19 empty_directory "#{plugin_path}/db/migrate"
20 20 empty_directory "#{plugin_path}/lib/tasks"
21 21 empty_directory "#{plugin_path}/assets/images"
22 22 empty_directory "#{plugin_path}/assets/javascripts"
23 23 empty_directory "#{plugin_path}/assets/stylesheets"
24 24 empty_directory "#{plugin_path}/config/locales"
25 25 empty_directory "#{plugin_path}/test"
26 empty_directory "#{plugin_path}/test/fixtures"
27 empty_directory "#{plugin_path}/test/unit"
28 empty_directory "#{plugin_path}/test/functional"
29 empty_directory "#{plugin_path}/test/integration"
26 30
27 31 template 'README.rdoc', "#{plugin_path}/README.rdoc"
28 32 template 'init.rb.erb', "#{plugin_path}/init.rb"
29 33 template 'routes.rb', "#{plugin_path}/config/routes.rb"
30 34 template 'en_rails_i18n.yml', "#{plugin_path}/config/locales/en.yml"
31 35 template 'test_helper.rb.erb', "#{plugin_path}/test/test_helper.rb"
32 36 end
33 37 end
@@ -1,8 +1,8
1 require File.dirname(__FILE__) + '/../test_helper'
1 require File.expand_path('../../test_helper', __FILE__)
2 2
3 3 class <%= @controller_class %>ControllerTest < ActionController::TestCase
4 4 # Replace this with your real tests.
5 5 def test_truth
6 6 assert true
7 7 end
8 8 end
@@ -1,9 +1,9
1 require File.dirname(__FILE__) + '/../test_helper'
1 require File.expand_path('../../test_helper', __FILE__)
2 2
3 3 class <%= @model_class %>Test < ActiveSupport::TestCase
4 4
5 5 # Replace this with your real tests.
6 6 def test_truth
7 7 assert true
8 8 end
9 9 end
General Comments 0
You need to be logged in to leave comments. Login now