aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authoreileencodes <eileencodes@gmail.com>2017-02-20 14:38:46 -0500
committereileencodes <eileencodes@gmail.com>2017-02-20 15:07:35 -0500
commit2d61c5d846f8dd3a02080fedce7ab63b8d314db6 (patch)
tree0b534cf1fc2f9996fac26392cc0f673e904ac65c /actionpack
parent161cf89e134267f9b579f493ca19b12c30d5fd36 (diff)
downloadrails-2d61c5d846f8dd3a02080fedce7ab63b8d314db6.tar.gz
rails-2d61c5d846f8dd3a02080fedce7ab63b8d314db6.tar.bz2
rails-2d61c5d846f8dd3a02080fedce7ab63b8d314db6.zip
Rename system_test_helper -> application_system_test_case
This renames the system test helper file to be application system test case to match what the rest of Rails does. In the future we should consider changing the test_helper to match.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/system_test_case.rb25
-rw-r--r--actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb6
2 files changed, 9 insertions, 22 deletions
diff --git a/actionpack/lib/action_dispatch/system_test_case.rb b/actionpack/lib/action_dispatch/system_test_case.rb
index 91cbc1180c..ca23cab6ae 100644
--- a/actionpack/lib/action_dispatch/system_test_case.rb
+++ b/actionpack/lib/action_dispatch/system_test_case.rb
@@ -17,12 +17,12 @@ module ActionDispatch
# To create a system test in your application, extend your test class
# from <tt>ApplicationSystemTestCase</tt>. System tests use Capybara as a
# base and allow you to configure the settings through your
- # <tt>system_test_helper.rb</tt> file that is generated with a new
+ # <tt>application_system_test_case.rb</tt> file that is generated with a new
# application or scaffold.
#
# Here is an example system test:
#
- # require 'system_test_helper'
+ # require 'application_system_test_case'
#
# class Users::CreateTest < ApplicationSystemTestCase
# test "adding a new user" do
@@ -36,7 +36,7 @@ module ActionDispatch
# end
# end
#
- # When generating an application or scaffold a +system_test_helper.rb+ will also
+ # When generating an application or scaffold a +application_system_test_case.rb+ will also
# be generated containing the base class for system testing. This is where you
# can change the driver, add Capybara settings, and other configuration for
# your system tests.
@@ -44,28 +44,20 @@ module ActionDispatch
# require "test_helper"
#
# class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
- # teardown do
- # take_failed_screenshot
- # Capybara.reset_sessions!
- # end
+ # driven_by :selenium, using: :chrome, screen_size: [1400, 1400]
# end
#
# By default, <tt>ActionDispatch::SystemTestCase</tt> is driven by the
# Selenium driver, with the Chrome browser, and a browser size of 1400x1400.
#
# Changing the driver configuration options are easy. Let's say you want to use
- # and the Firefox browser instead. In your +system_test_helper.rb+
+ # and the Firefox browser instead. In your +application_system_test_case.rb+
# file add the following:
#
# require "test_helper"
#
# class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
# driven_by :selenium, using: :firefox
- #
- # teardown do
- # take_failed_screenshot
- # Capybara.reset_sessions!
- # end
# end
#
# +driven_by+ has a required argument for the driver name. The keyword
@@ -74,7 +66,7 @@ module ActionDispatch
#
# To use a headless driver, like Poltergeist, update your Gemfile to use
# Poltergeist instead of Selenium and then declare the driver name in the
- # +system_test_helper.rb+ file. In this case you would leave out the +:using+
+ # +application_system_test_case.rb+ file. In this case you would leave out the +:using+
# option because the driver is headless.
#
# require "test_helper"
@@ -82,11 +74,6 @@ module ActionDispatch
#
# class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
# driven_by :poltergeist
- #
- # teardown do
- # take_failed_screenshot
- # Capybara.reset_sessions!
- # end
# end
#
# Because <tt>ActionDispatch::SystemTestCase</tt> is a shim between Capybara
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 ab14910b41..784005cb93 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,9 +17,9 @@ module ActionDispatch
# Takes a screenshot of the current page in the browser if the test
# failed.
#
- # +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
+ # +take_failed_screenshot+ is included in <tt>application_system_test_case.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.
def take_failed_screenshot
take_screenshot unless passed?