diff options
author | Akira Matsuda <ronnie@dio.jp> | 2011-05-18 20:36:25 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2011-05-18 21:08:08 +0900 |
commit | 22ed6cb798b476f63e5d5b84cb28e054c4f1870e (patch) | |
tree | 645408575753b975ddb1bae5821c14d898a80a09 /railties/lib/rails/generators/test_unit | |
parent | 9d8e2fb5e21da725755366ae2b7affe83ce1b6b0 (diff) | |
download | rails-22ed6cb798b476f63e5d5b84cb28e054c4f1870e.tar.gz rails-22ed6cb798b476f63e5d5b84cb28e054c4f1870e.tar.bz2 rails-22ed6cb798b476f63e5d5b84cb28e054c4f1870e.zip |
for ... in => .each
I believe this is more modern way
Diffstat (limited to 'railties/lib/rails/generators/test_unit')
3 files changed, 5 insertions, 5 deletions
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 index 0bc5fd8ca2..509bd60564 100644 --- a/railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb +++ b/railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb @@ -7,7 +7,7 @@ class <%= class_name %>ControllerTest < ActionController::TestCase # assert true # end <% else -%> -<% for action in actions -%> +<% actions.each do |action| -%> test "should get <%= action %>" do get :<%= action %> assert_response :success 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 index c05102290c..7e204105a3 100644 --- a/railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb +++ b/railties/lib/rails/generators/test_unit/mailer/templates/functional_test.rb @@ -2,7 +2,7 @@ require 'test_helper' <% module_namespacing do -%> class <%= class_name %>Test < ActionMailer::TestCase -<% for action in actions -%> +<% actions.each do |action| -%> test "<%= action %>" do mail = <%= class_name %>.<%= action %> assert_equal <%= action.to_s.humanize.inspect %>, mail.subject diff --git a/railties/lib/rails/generators/test_unit/model/templates/fixtures.yml b/railties/lib/rails/generators/test_unit/model/templates/fixtures.yml index 6465a6a6e2..d4138ca2f5 100644 --- a/railties/lib/rails/generators/test_unit/model/templates/fixtures.yml +++ b/railties/lib/rails/generators/test_unit/model/templates/fixtures.yml @@ -2,12 +2,12 @@ <% unless attributes.empty? -%> one: -<% for attribute in attributes -%> +<% attributes.each do |attribute| -%> <%= attribute.name %>: <%= attribute.default %> <% end -%> two: -<% for attribute in attributes -%> +<% attributes.each do |attribute| -%> <%= attribute.name %>: <%= attribute.default %> <% end -%> <% else -%> @@ -20,4 +20,4 @@ one: {} # two: {} # column: value -<% end -%>
\ No newline at end of file +<% end -%> |