diff options
author | eileencodes <eileencodes@gmail.com> | 2017-02-19 12:12:06 -0500 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2017-02-20 15:07:35 -0500 |
commit | 983275eb7c01eaeba5798a422514f4d9d6b74786 (patch) | |
tree | 66efc4113f0ed66ea23c6522fde5a1b011e6f7d3 /actionpack/lib/action_dispatch | |
parent | dbb60ff588f770d01b4b4ebc3905ff305c92ddd1 (diff) | |
download | rails-983275eb7c01eaeba5798a422514f4d9d6b74786.tar.gz rails-983275eb7c01eaeba5798a422514f4d9d6b74786.tar.bz2 rails-983275eb7c01eaeba5798a422514f4d9d6b74786.zip |
Fix screenshot helper to provide correct file name
We only want the file name to include the word `failures` if it failed,
not any time the user wants to take a screenshot during a test run.
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb b/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb index 1ad64b7f78..ab14910b41 100644 --- a/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +++ b/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb @@ -17,7 +17,7 @@ module ActionDispatch # Takes a screenshot of the current page in the browser if the test # failed. # - # +take_screenshot+ is included in <tt>system_test_helper.rb</tt> that is + # +take_failed_screenshot+ is included in <tt>system_test_helper.rb</tt> that is # generated with the application. To take screenshots when a test fails # add +take_failed_screenshot+ to the teardown block before clearing # sessions. @@ -26,8 +26,12 @@ module ActionDispatch end private + def image_name + passed? ? method_name : "failures_#{method_name}" + end + def image_path - "tmp/screenshots/failures_#{method_name}.png" + "tmp/screenshots/#{image_name}.png" end def save_image |