1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #34691 from gmcgibbon/rm_helper_generator_suffix

Remove redundant suffixes on generated helpers.
This commit is contained in:
Ryuta Kamizono 2018-12-13 02:57:00 +09:00
commit 8fcaf3c26c
3 changed files with 16 additions and 0 deletions

View file

@ -1,3 +1,7 @@
* Remove redundant suffixes on generated helpers.
*Gannon McGibbon*
* Remove redundant suffixes on generated integration tests.
*Gannon McGibbon*

View file

@ -10,6 +10,11 @@ module Rails
end
hook_for :test_framework
private
def file_name
@_file_name ||= super.sub(/_helper\z/i, "")
end
end
end
end

View file

@ -38,4 +38,11 @@ class HelperGeneratorTest < Rails::Generators::TestCase
end
end
end
def test_helper_suffix_is_not_duplicated
run_generator %w(products_helper)
assert_no_file "app/helpers/products_helper_helper.rb"
assert_file "app/helpers/products_helper.rb"
end
end