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

Remove redundant suffixes on generated helpers.

This commit is contained in:
Gannon McGibbon 2018-12-12 12:22:59 -05:00
parent 662f14814e
commit 886ac1c308
3 changed files with 16 additions and 0 deletions

View file

@ -1,3 +1,7 @@
* Remove redundant suffixes on generated helpers.
*Gannon McGibbon*
* Fix boolean interaction in scaffold system tests. * Fix boolean interaction in scaffold system tests.
*Gannon McGibbon* *Gannon McGibbon*

View file

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

View file

@ -38,4 +38,11 @@ class HelperGeneratorTest < Rails::Generators::TestCase
end end
end 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 end