diff options
Diffstat (limited to 'railties/lib/rails/generators')
15 files changed, 30 insertions, 29 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index b71b16b043..98997864de 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -113,9 +113,11 @@ module Rails def test empty_directory_with_keep_file 'test/fixtures' - empty_directory_with_keep_file 'test/functional' + empty_directory_with_keep_file 'test/controllers' + empty_directory_with_keep_file 'test/mailers' + empty_directory_with_keep_file 'test/models' + empty_directory_with_keep_file 'test/helpers' empty_directory_with_keep_file 'test/integration' - empty_directory_with_keep_file 'test/unit' template 'test/performance/browsing_test.rb' template 'test/test_helper.rb' diff --git a/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt b/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt index f61e481969..7342bffd9d 100644 --- a/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt +++ b/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt @@ -5,7 +5,7 @@ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. // // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the -// the compiled file. +// compiled file. // // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD // GO AFTER THE REQUIRES BELOW. diff --git a/railties/lib/rails/generators/rails/app/templates/config/application.rb b/railties/lib/rails/generators/rails/app/templates/config/application.rb index 81bf22a159..fb43c90e21 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/application.rb +++ b/railties/lib/rails/generators/rails/app/templates/config/application.rb @@ -23,14 +23,6 @@ module <%= app_const_base %> # Custom directories with classes and modules you want to be autoloadable. # config.autoload_paths += %W(#{config.root}/extras) - # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. - # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. - # config.time_zone = 'Central Time (US & Canada)' - - # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. - # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] - # config.i18n.default_locale = :de - # Configure sensitive parameters which will be filtered from the log file. config.filter_parameters += [:password] diff --git a/railties/lib/rails/generators/rails/app/templates/config/initializers/locale.rb b/railties/lib/rails/generators/rails/app/templates/config/initializers/locale.rb new file mode 100644 index 0000000000..a8285f88ca --- /dev/null +++ b/railties/lib/rails/generators/rails/app/templates/config/initializers/locale.rb @@ -0,0 +1,7 @@ +# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. +# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. +# Rails.application.config.time_zone = 'Central Time (US & Canada)' + +# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. +# Rails.application.config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] +# Rails.application.config.i18n.default_locale = :de diff --git a/railties/lib/rails/generators/rails/controller/USAGE b/railties/lib/rails/generators/rails/controller/USAGE index b658777b12..9def4af65c 100644 --- a/railties/lib/rails/generators/rails/controller/USAGE +++ b/railties/lib/rails/generators/rails/controller/USAGE @@ -12,7 +12,7 @@ Example: `rails generate controller CreditCards open debit credit close` CreditCards controller with URLs like /credit_cards/debit. - Controller: app/controllers/credit_cards_controller.rb - Functional Test: test/functional/credit_cards_controller_test.rb - Views: app/views/credit_cards/debit.html.erb [...] - Helper: app/helpers/credit_cards_helper.rb + Controller: app/controllers/credit_cards_controller.rb + Test: test/controllers/credit_cards_controller_test.rb + Views: app/views/credit_cards/debit.html.erb [...] + Helper: app/helpers/credit_cards_helper.rb diff --git a/railties/lib/rails/generators/rails/helper/USAGE b/railties/lib/rails/generators/rails/helper/USAGE index c0ddb0f606..30e323a858 100644 --- a/railties/lib/rails/generators/rails/helper/USAGE +++ b/railties/lib/rails/generators/rails/helper/USAGE @@ -13,5 +13,5 @@ Example: Credit card helper. Helper: app/helpers/credit_card_helper.rb - Test: test/unit/helpers/credit_card_helper_test.rb + Test: test/helpers/credit_card_helper_test.rb diff --git a/railties/lib/rails/generators/rails/model/USAGE b/railties/lib/rails/generators/rails/model/USAGE index c46c86076e..e29e19490e 100644 --- a/railties/lib/rails/generators/rails/model/USAGE +++ b/railties/lib/rails/generators/rails/model/USAGE @@ -74,7 +74,7 @@ Examples: For ActiveRecord and TestUnit it creates: Model: app/models/account.rb - Test: test/unit/account_test.rb + Test: test/models/account_test.rb Fixtures: test/fixtures/accounts.yml Migration: db/migrate/XXX_add_accounts.rb @@ -88,7 +88,7 @@ Examples: Module: app/models/admin.rb Model: app/models/admin/account.rb - Test: test/unit/admin/account_test.rb + Test: test/models/admin/account_test.rb Fixtures: test/fixtures/admin/accounts.yml Migration: db/migrate/XXX_add_admin_accounts.rb diff --git a/railties/lib/rails/generators/rails/observer/USAGE b/railties/lib/rails/generators/rails/observer/USAGE index d8f32a6a48..177ff49e4a 100644 --- a/railties/lib/rails/generators/rails/observer/USAGE +++ b/railties/lib/rails/generators/rails/observer/USAGE @@ -9,4 +9,4 @@ Example: For ActiveRecord and TestUnit it creates: Observer: app/models/account_observer.rb - TestUnit: test/unit/account_observer_test.rb + TestUnit: test/models/account_observer_test.rb diff --git a/railties/lib/rails/generators/rails/scaffold_controller/USAGE b/railties/lib/rails/generators/rails/scaffold_controller/USAGE index 5cd51b62d4..8ba4c5ccbc 100644 --- a/railties/lib/rails/generators/rails/scaffold_controller/USAGE +++ b/railties/lib/rails/generators/rails/scaffold_controller/USAGE @@ -13,7 +13,7 @@ Example: `rails generate scaffold_controller CreditCard` Credit card controller with URLs like /credit_card/debit. - Controller: app/controllers/credit_cards_controller.rb - Functional Test: test/functional/credit_cards_controller_test.rb - Views: app/views/credit_cards/index.html.erb [...] - Helper: app/helpers/credit_cards_helper.rb + Controller: app/controllers/credit_cards_controller.rb + Test: test/controllers/credit_cards_controller_test.rb + Views: app/views/credit_cards/index.html.erb [...] + Helper: app/helpers/credit_cards_helper.rb diff --git a/railties/lib/rails/generators/test_unit/controller/controller_generator.rb b/railties/lib/rails/generators/test_unit/controller/controller_generator.rb index 20f3bd8965..db99e55e9e 100644 --- a/railties/lib/rails/generators/test_unit/controller/controller_generator.rb +++ b/railties/lib/rails/generators/test_unit/controller/controller_generator.rb @@ -8,7 +8,7 @@ module TestUnit def create_test_files template 'functional_test.rb', - File.join('test/functional', class_path, "#{file_name}_controller_test.rb") + File.join('test/controllers', class_path, "#{file_name}_controller_test.rb") end end end diff --git a/railties/lib/rails/generators/test_unit/helper/helper_generator.rb b/railties/lib/rails/generators/test_unit/helper/helper_generator.rb index 4ea80bf7be..d4c287540c 100644 --- a/railties/lib/rails/generators/test_unit/helper/helper_generator.rb +++ b/railties/lib/rails/generators/test_unit/helper/helper_generator.rb @@ -6,7 +6,7 @@ module TestUnit check_class_collision :suffix => "HelperTest" def create_helper_files - template 'helper_test.rb', File.join('test/unit/helpers', class_path, "#{file_name}_helper_test.rb") + template 'helper_test.rb', File.join('test/helpers', class_path, "#{file_name}_helper_test.rb") end end end diff --git a/railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb b/railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb index 1a49286d41..a404a13bd2 100644 --- a/railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb +++ b/railties/lib/rails/generators/test_unit/mailer/mailer_generator.rb @@ -7,7 +7,7 @@ module TestUnit check_class_collision :suffix => "Test" def create_test_files - template "functional_test.rb", File.join('test/functional', class_path, "#{file_name}_test.rb") + template "functional_test.rb", File.join('test/mailers', class_path, "#{file_name}_test.rb") end end end diff --git a/railties/lib/rails/generators/test_unit/model/model_generator.rb b/railties/lib/rails/generators/test_unit/model/model_generator.rb index c1dd535dd3..ffb51e437d 100644 --- a/railties/lib/rails/generators/test_unit/model/model_generator.rb +++ b/railties/lib/rails/generators/test_unit/model/model_generator.rb @@ -9,7 +9,7 @@ module TestUnit check_class_collision :suffix => "Test" def create_test_file - template 'unit_test.rb', File.join('test/unit', class_path, "#{file_name}_test.rb") + template 'unit_test.rb', File.join('test/models', class_path, "#{file_name}_test.rb") end hook_for :fixture_replacement diff --git a/railties/lib/rails/generators/test_unit/observer/observer_generator.rb b/railties/lib/rails/generators/test_unit/observer/observer_generator.rb index 6cc1158c21..658373d554 100644 --- a/railties/lib/rails/generators/test_unit/observer/observer_generator.rb +++ b/railties/lib/rails/generators/test_unit/observer/observer_generator.rb @@ -6,7 +6,7 @@ module TestUnit check_class_collision :suffix => "ObserverTest" def create_test_files - template 'unit_test.rb', File.join('test/unit', class_path, "#{file_name}_observer_test.rb") + template 'unit_test.rb', File.join('test/models', class_path, "#{file_name}_observer_test.rb") end end end diff --git a/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb b/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb index ca7fee3b6e..e9de51ba72 100644 --- a/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb +++ b/railties/lib/rails/generators/test_unit/scaffold/scaffold_generator.rb @@ -12,7 +12,7 @@ module TestUnit def create_test_files template "functional_test.rb", - File.join("test/functional", controller_class_path, "#{controller_file_name}_controller_test.rb") + File.join("test/controllers", controller_class_path, "#{controller_file_name}_controller_test.rb") end private |