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:
parent
662f14814e
commit
886ac1c308
3 changed files with 16 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
* Remove redundant suffixes on generated helpers.
|
||||
|
||||
*Gannon McGibbon*
|
||||
|
||||
* Fix boolean interaction in scaffold system tests.
|
||||
|
||||
*Gannon McGibbon*
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue