aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-12-21 17:36:30 +0900
committerGitHub <noreply@github.com>2018-12-21 17:36:30 +0900
commitb75192845a6aa89b35c857e9f3de443ae1a0fbd5 (patch)
treec300f14774b7556a21514ee35a45b850fae7806b /actionpack/test/dispatch/system_testing/screenshot_helper_test.rb
parent07235ec37130437cb97c90e14fc8d990f46e4024 (diff)
parent892e38c78e03c11afaa5f01d995e3a21bd92b415 (diff)
downloadrails-b75192845a6aa89b35c857e9f3de443ae1a0fbd5.tar.gz
rails-b75192845a6aa89b35c857e9f3de443ae1a0fbd5.tar.bz2
rails-b75192845a6aa89b35c857e9f3de443ae1a0fbd5.zip
Merge pull request #34764 from kamipo/avoid_redundant_begin
Enable `Style/RedundantBegin` cop to avoid newly adding redundant begin block
Diffstat (limited to 'actionpack/test/dispatch/system_testing/screenshot_helper_test.rb')
-rw-r--r--actionpack/test/dispatch/system_testing/screenshot_helper_test.rb20
1 files changed, 9 insertions, 11 deletions
diff --git a/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb b/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb
index de79c05657..097ef8af29 100644
--- a/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb
+++ b/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb
@@ -41,22 +41,20 @@ class ScreenshotHelperTest < ActiveSupport::TestCase
end
test "display_image return artifact format when specify RAILS_SYSTEM_TESTING_SCREENSHOT environment" do
- begin
- original_output_type = ENV["RAILS_SYSTEM_TESTING_SCREENSHOT"]
- ENV["RAILS_SYSTEM_TESTING_SCREENSHOT"] = "artifact"
+ original_output_type = ENV["RAILS_SYSTEM_TESTING_SCREENSHOT"]
+ ENV["RAILS_SYSTEM_TESTING_SCREENSHOT"] = "artifact"
- new_test = DrivenBySeleniumWithChrome.new("x")
+ new_test = DrivenBySeleniumWithChrome.new("x")
- assert_equal "artifact", new_test.send(:output_type)
+ assert_equal "artifact", new_test.send(:output_type)
- Rails.stub :root, Pathname.getwd do
- new_test.stub :passed?, false do
- assert_match %r|url=artifact://.+?tmp/screenshots/failures_x\.png|, new_test.send(:display_image)
- end
+ Rails.stub :root, Pathname.getwd do
+ new_test.stub :passed?, false do
+ assert_match %r|url=artifact://.+?tmp/screenshots/failures_x\.png|, new_test.send(:display_image)
end
- ensure
- ENV["RAILS_SYSTEM_TESTING_SCREENSHOT"] = original_output_type
end
+ ensure
+ ENV["RAILS_SYSTEM_TESTING_SCREENSHOT"] = original_output_type
end
test "image path returns the absolute path from root" do