1
0
Fork 0
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:
Ryuta Kamizono 2018-12-13 02:48:06 +09:00 committed by GitHub
commit 047d4f2605
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 0 deletions

View file

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

View file

@ -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

View file

@ -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