From f945152fa5975580f07afff1bfdc01769a1e8a5f Mon Sep 17 00:00:00 2001 From: Sam Phippen Date: Sat, 16 Jun 2018 12:36:42 -0400 Subject: [PATCH 1/2] Truncate method names in system tests --- lib/rspec/rails/example/system_example_group.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/rspec/rails/example/system_example_group.rb b/lib/rspec/rails/example/system_example_group.rb index aebf954d07..89d471a5f5 100644 --- a/lib/rspec/rails/example/system_example_group.rb +++ b/lib/rspec/rails/example/system_example_group.rb @@ -37,8 +37,7 @@ def method_name @method_name ||= [ self.class.name.underscore, RSpec.current_example.description.underscore, - rand(1000) - ].join("_").tr(CHARS_TO_TRANSLATE.join, "_") + ].join("_").tr(CHARS_TO_TRANSLATE.join, "_")[0...251] + "_#{rand(1000)}" end # Delegates to `Rails.application`. From 28ccf958f9b67332ef3f31fd75082d68b7af5443 Mon Sep 17 00:00:00 2001 From: Sam Phippen Date: Sat, 16 Jun 2018 14:42:12 -0400 Subject: [PATCH 2/2] Rubbycop --- lib/rspec/rails/example/system_example_group.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rspec/rails/example/system_example_group.rb b/lib/rspec/rails/example/system_example_group.rb index 89d471a5f5..ce5fcfbb60 100644 --- a/lib/rspec/rails/example/system_example_group.rb +++ b/lib/rspec/rails/example/system_example_group.rb @@ -36,7 +36,7 @@ def passed? def method_name @method_name ||= [ self.class.name.underscore, - RSpec.current_example.description.underscore, + RSpec.current_example.description.underscore ].join("_").tr(CHARS_TO_TRANSLATE.join, "_")[0...251] + "_#{rand(1000)}" end