From b5c5121f67c88a2be1c56e810f5c64013351ce79 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Tue, 10 Dec 2013 18:05:13 -0200 Subject: Revert "Rename not Ruby files to .tt" This reverts commit bd360ad3c1d59273bf96ea01b17cf04285816dc2. Reverting this for now until we fix the Thor related issue --- .../controller/templates/functional_test.rb | 19 ++++++++ .../controller/templates/functional_test.rb.tt | 19 -------- .../generator/templates/generator_test.rb | 16 +++++++ .../generator/templates/generator_test.rb.tt | 16 ------- .../test_unit/helper/templates/helper_test.rb | 6 +++ .../test_unit/helper/templates/helper_test.rb.tt | 6 --- .../integration/templates/integration_test.rb | 7 +++ .../integration/templates/integration_test.rb.tt | 7 --- .../test_unit/mailer/templates/functional_test.rb | 21 +++++++++ .../mailer/templates/functional_test.rb.tt | 21 --------- .../scaffold/templates/functional_test.rb | 51 ++++++++++++++++++++++ .../scaffold/templates/functional_test.rb.tt | 51 ---------------------- 12 files changed, 120 insertions(+), 120 deletions(-) create mode 100644 railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb delete mode 100644 railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb.tt create mode 100644 railties/lib/rails/generators/test_unit/generator/templates/generator_test.rb delete mode 100644 railties/lib/rails/generators/test_unit/generator/templates/generator_test.rb.tt create mode 100644 railties/lib/rails/generators/test_unit/helper/templates/helper_test.rb delete mode 100644 railties/lib/rails/generators/test_unit/helper/templates/helper_test.rb.tt create mode 100644 railties/lib/rails/generators/test_unit/integration/templates/integration_test.rb delete mode 100644 railties/lib/rails/generators/test_unit/integration/templates/integration_test.rb.tt create mode 100644 railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb delete mode 100644 railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb.tt create mode 100644 railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb delete mode 100644 railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb.tt (limited to 'railties/lib/rails/generators/test_unit') diff --git a/railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb b/railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb new file mode 100644 index 0000000000..509bd60564 --- /dev/null +++ b/railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb @@ -0,0 +1,19 @@ +require 'test_helper' + +<% module_namespacing do -%> +class <%= class_name %>ControllerTest < ActionController::TestCase +<% if actions.empty? -%> + # test "the truth" do + # assert true + # end +<% else -%> +<% actions.each do |action| -%> + test "should get <%= action %>" do + get :<%= action %> + assert_response :success + end + +<% end -%> +<% end -%> +end +<% end -%> diff --git a/railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb.tt b/railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb.tt deleted file mode 100644 index 509bd60564..0000000000 --- a/railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb.tt +++ /dev/null @@ -1,19 +0,0 @@ -require 'test_helper' - -<% module_namespacing do -%> -class <%= class_name %>ControllerTest < ActionController::TestCase -<% if actions.empty? -%> - # test "the truth" do - # assert true - # end -<% else -%> -<% actions.each do |action| -%> - test "should get <%= action %>" do - get :<%= action %> - assert_response :success - end - -<% end -%> -<% end -%> -end -<% end -%> diff --git a/railties/lib/rails/generators/test_unit/generator/templates/generator_test.rb b/railties/lib/rails/generators/test_unit/generator/templates/generator_test.rb new file mode 100644 index 0000000000..a7f1fc4fba --- /dev/null +++ b/railties/lib/rails/generators/test_unit/generator/templates/generator_test.rb @@ -0,0 +1,16 @@ +require 'test_helper' +require '<%= generator_path %>' + +<% module_namespacing do -%> +class <%= class_name %>GeneratorTest < Rails::Generators::TestCase + tests <%= class_name %>Generator + destination Rails.root.join('tmp/generators') + setup :prepare_destination + + # test "generator runs without errors" do + # assert_nothing_raised do + # run_generator ["arguments"] + # end + # end +end +<% end -%> diff --git a/railties/lib/rails/generators/test_unit/generator/templates/generator_test.rb.tt b/railties/lib/rails/generators/test_unit/generator/templates/generator_test.rb.tt deleted file mode 100644 index a7f1fc4fba..0000000000 --- a/railties/lib/rails/generators/test_unit/generator/templates/generator_test.rb.tt +++ /dev/null @@ -1,16 +0,0 @@ -require 'test_helper' -require '<%= generator_path %>' - -<% module_namespacing do -%> -class <%= class_name %>GeneratorTest < Rails::Generators::TestCase - tests <%= class_name %>Generator - destination Rails.root.join('tmp/generators') - setup :prepare_destination - - # test "generator runs without errors" do - # assert_nothing_raised do - # run_generator ["arguments"] - # end - # end -end -<% end -%> diff --git a/railties/lib/rails/generators/test_unit/helper/templates/helper_test.rb b/railties/lib/rails/generators/test_unit/helper/templates/helper_test.rb new file mode 100644 index 0000000000..7d37bda0f9 --- /dev/null +++ b/railties/lib/rails/generators/test_unit/helper/templates/helper_test.rb @@ -0,0 +1,6 @@ +require 'test_helper' + +<% module_namespacing do -%> +class <%= class_name %>HelperTest < ActionView::TestCase +end +<% end -%> diff --git a/railties/lib/rails/generators/test_unit/helper/templates/helper_test.rb.tt b/railties/lib/rails/generators/test_unit/helper/templates/helper_test.rb.tt deleted file mode 100644 index 7d37bda0f9..0000000000 --- a/railties/lib/rails/generators/test_unit/helper/templates/helper_test.rb.tt +++ /dev/null @@ -1,6 +0,0 @@ -require 'test_helper' - -<% module_namespacing do -%> -class <%= class_name %>HelperTest < ActionView::TestCase -end -<% end -%> diff --git a/railties/lib/rails/generators/test_unit/integration/templates/integration_test.rb b/railties/lib/rails/generators/test_unit/integration/templates/integration_test.rb new file mode 100644 index 0000000000..dea7e22196 --- /dev/null +++ b/railties/lib/rails/generators/test_unit/integration/templates/integration_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class <%= class_name %>Test < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end diff --git a/railties/lib/rails/generators/test_unit/integration/templates/integration_test.rb.tt b/railties/lib/rails/generators/test_unit/integration/templates/integration_test.rb.tt deleted file mode 100644 index dea7e22196..0000000000 --- a/railties/lib/rails/generators/test_unit/integration/templates/integration_test.rb.tt +++ /dev/null @@ -1,7 +0,0 @@ -require 'test_helper' - -class <%= class_name %>Test < ActionDispatch::IntegrationTest - # test "the truth" do - # assert true - # end -end diff --git a/railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb b/railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb new file mode 100644 index 0000000000..7e204105a3 --- /dev/null +++ b/railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb @@ -0,0 +1,21 @@ +require 'test_helper' + +<% module_namespacing do -%> +class <%= class_name %>Test < ActionMailer::TestCase +<% actions.each do |action| -%> + test "<%= action %>" do + mail = <%= class_name %>.<%= action %> + assert_equal <%= action.to_s.humanize.inspect %>, mail.subject + assert_equal ["to@example.org"], mail.to + assert_equal ["from@example.com"], mail.from + assert_match "Hi", mail.body.encoded + end + +<% end -%> +<% if actions.blank? -%> + # test "the truth" do + # assert true + # end +<% end -%> +end +<% end -%> diff --git a/railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb.tt b/railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb.tt deleted file mode 100644 index 7e204105a3..0000000000 --- a/railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb.tt +++ /dev/null @@ -1,21 +0,0 @@ -require 'test_helper' - -<% module_namespacing do -%> -class <%= class_name %>Test < ActionMailer::TestCase -<% actions.each do |action| -%> - test "<%= action %>" do - mail = <%= class_name %>.<%= action %> - assert_equal <%= action.to_s.humanize.inspect %>, mail.subject - assert_equal ["to@example.org"], mail.to - assert_equal ["from@example.com"], mail.from - assert_match "Hi", mail.body.encoded - end - -<% end -%> -<% if actions.blank? -%> - # test "the truth" do - # assert true - # end -<% end -%> -end -<% end -%> diff --git a/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb b/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb new file mode 100644 index 0000000000..18bd1ece9d --- /dev/null +++ b/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb @@ -0,0 +1,51 @@ +require 'test_helper' + +<% module_namespacing do -%> +class <%= controller_class_name %>ControllerTest < ActionController::TestCase + setup do + @<%= singular_table_name %> = <%= table_name %>(:one) + end + + test "should get index" do + get :index + assert_response :success + assert_not_nil assigns(:<%= table_name %>) + end + + test "should get new" do + get :new + assert_response :success + end + + test "should create <%= singular_table_name %>" do + assert_difference('<%= class_name %>.count') do + post :create, <%= "#{singular_table_name}: { #{attributes_hash} }" %> + end + + assert_redirected_to <%= singular_table_name %>_path(assigns(:<%= singular_table_name %>)) + end + + test "should show <%= singular_table_name %>" do + get :show, id: <%= "@#{singular_table_name}" %> + assert_response :success + end + + test "should get edit" do + get :edit, id: <%= "@#{singular_table_name}" %> + assert_response :success + end + + test "should update <%= singular_table_name %>" do + patch :update, id: <%= "@#{singular_table_name}" %>, <%= "#{singular_table_name}: { #{attributes_hash} }" %> + assert_redirected_to <%= singular_table_name %>_path(assigns(:<%= singular_table_name %>)) + end + + test "should destroy <%= singular_table_name %>" do + assert_difference('<%= class_name %>.count', -1) do + delete :destroy, id: <%= "@#{singular_table_name}" %> + end + + assert_redirected_to <%= index_helper %>_path + end +end +<% end -%> diff --git a/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb.tt b/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb.tt deleted file mode 100644 index 18bd1ece9d..0000000000 --- a/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb.tt +++ /dev/null @@ -1,51 +0,0 @@ -require 'test_helper' - -<% module_namespacing do -%> -class <%= controller_class_name %>ControllerTest < ActionController::TestCase - setup do - @<%= singular_table_name %> = <%= table_name %>(:one) - end - - test "should get index" do - get :index - assert_response :success - assert_not_nil assigns(:<%= table_name %>) - end - - test "should get new" do - get :new - assert_response :success - end - - test "should create <%= singular_table_name %>" do - assert_difference('<%= class_name %>.count') do - post :create, <%= "#{singular_table_name}: { #{attributes_hash} }" %> - end - - assert_redirected_to <%= singular_table_name %>_path(assigns(:<%= singular_table_name %>)) - end - - test "should show <%= singular_table_name %>" do - get :show, id: <%= "@#{singular_table_name}" %> - assert_response :success - end - - test "should get edit" do - get :edit, id: <%= "@#{singular_table_name}" %> - assert_response :success - end - - test "should update <%= singular_table_name %>" do - patch :update, id: <%= "@#{singular_table_name}" %>, <%= "#{singular_table_name}: { #{attributes_hash} }" %> - assert_redirected_to <%= singular_table_name %>_path(assigns(:<%= singular_table_name %>)) - end - - test "should destroy <%= singular_table_name %>" do - assert_difference('<%= class_name %>.count', -1) do - delete :destroy, id: <%= "@#{singular_table_name}" %> - end - - assert_redirected_to <%= index_helper %>_path - end -end -<% end -%> -- cgit v1.2.3