aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJosi McClellan <josiahmcclellan07@gmail.com>2019-04-18 15:20:22 -0500
committerJosi McClellan <josiahmcclellan07@gmail.com>2019-04-18 15:20:22 -0500
commit51cb5d4a2078a2139f58d1bac964f2844dd0ac19 (patch)
tree53116d03758b5a432993af423da247fc454f0232 /actionpack/test
parent0f39a7488ed736a76cc6cee166fba01d1e3c5686 (diff)
downloadrails-51cb5d4a2078a2139f58d1bac964f2844dd0ac19.tar.gz
rails-51cb5d4a2078a2139f58d1bac964f2844dd0ac19.tar.bz2
rails-51cb5d4a2078a2139f58d1bac964f2844dd0ac19.zip
truncate screenshot filenames to avoid error
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/system_testing/screenshot_helper_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb b/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb
index b756b91379..b0b36f9d74 100644
--- a/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb
+++ b/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb
@@ -36,6 +36,14 @@ class ScreenshotHelperTest < ActiveSupport::TestCase
end
end
+ test "image name truncates names over 225 characters" do
+ new_test = DrivenBySeleniumWithChrome.new("x" * 400)
+
+ Rails.stub :root, Pathname.getwd do
+ assert_equal Rails.root.join("tmp/screenshots/#{"x" * 225}.png").to_s, new_test.send(:image_path)
+ end
+ end
+
test "defaults to simple output for the screenshot" do
new_test = DrivenBySeleniumWithChrome.new("x")
assert_equal "simple", new_test.send(:output_type)