aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorEileen M. Uchitelle <eileencodes@users.noreply.github.com>2019-04-19 10:30:59 -0400
committerGitHub <noreply@github.com>2019-04-19 10:30:59 -0400
commit612af1926c4501cf66dd1d8ea5b923bb80cf4bb1 (patch)
tree54ba8e52d15c77c8745d930bb0a269cc1a0b168d /actionpack/test
parent5e77be32a86320a20478073b2a34b5ea7aef2aed (diff)
parent51cb5d4a2078a2139f58d1bac964f2844dd0ac19 (diff)
downloadrails-612af1926c4501cf66dd1d8ea5b923bb80cf4bb1.tar.gz
rails-612af1926c4501cf66dd1d8ea5b923bb80cf4bb1.tar.bz2
rails-612af1926c4501cf66dd1d8ea5b923bb80cf4bb1.zip
Merge pull request #36000 from JosiMcClellan/fix-screenshot-filenames
handle long or duplicated screenshot filenames
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)