mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #34690 from gmcgibbon/rm_integration_test_generator_suffix
Remove redundant suffixes on generated integration tests.
This commit is contained in:
commit
047d4f2605
3 changed files with 17 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
* Remove redundant suffixes on generated integration tests.
|
||||
|
||||
*Gannon McGibbon*
|
||||
|
||||
* Fix boolean interaction in scaffold system tests.
|
||||
|
||||
*Gannon McGibbon*
|
||||
|
|
|
@ -10,6 +10,12 @@ module TestUnit # :nodoc:
|
|||
def create_test_files
|
||||
template "integration_test.rb", File.join("test/integration", class_path, "#{file_name}_test.rb")
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def file_name
|
||||
@_file_name ||= super.sub(/_test\z/i, "")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -15,4 +15,11 @@ class IntegrationTestGeneratorTest < Rails::Generators::TestCase
|
|||
run_generator %w(iguchi/integration)
|
||||
assert_file "test/integration/iguchi/integration_test.rb", /class Iguchi::IntegrationTest < ActionDispatch::IntegrationTest/
|
||||
end
|
||||
|
||||
def test_test_suffix_is_not_duplicated
|
||||
run_generator %w(integration_test)
|
||||
|
||||
assert_no_file "test/integration/integration_test_test.rb"
|
||||
assert_file "test/integration/integration_test.rb"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue