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/test | |
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/test')
-rw-r--r-- | actionpack/test/dispatch/system_testing/screenshot_helper_test.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb b/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb index 3da89f4a10..8c14f799b0 100644 --- a/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb +++ b/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb @@ -5,6 +5,14 @@ class ScreenshotHelperTest < ActiveSupport::TestCase test "image path is saved in tmp directory" do new_test = ActionDispatch::SystemTestCase.new("x") - assert_equal "tmp/screenshots/failures_x.png", new_test.send(:image_path) + assert_equal "tmp/screenshots/x.png", new_test.send(:image_path) + end + + test "image path includes failures text if test did not pass" do + new_test = ActionDispatch::SystemTestCase.new("x") + + new_test.stub :passed?, false do + assert_equal "tmp/screenshots/failures_x.png", new_test.send(:image_path) + end end end |