Skip to content

Commit 5181930

Browse files
committed
Make the system test gsub less finicky
1 parent beee580 commit 5181930

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/generators/test_unit/scaffold/scaffold_generator.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ module Generators # :nodoc:
55
class ScaffoldGenerator < Base # :nodoc:
66
def fix_system_test
77
if turbo_defined?
8-
gsub_file File.join("test/system", class_path, "#{file_name.pluralize}_test.rb"), "click_on \"Destroy this #{human_name.downcase}\", match: :first", "accept_confirm { click_on \"Destroy this #{human_name.downcase}\", match: :first }"
8+
gsub_file File.join("test/system", class_path, "#{file_name.pluralize}_test.rb"),
9+
/(click_on.*Destroy this.*)$/,
10+
"accept_confirm { \\1 }"
911
end
1012
end
1113

0 commit comments

Comments
 (0)