From 97d8b7abfe75b6a7617966ad0b3d37ae9fc7adb8 Mon Sep 17 00:00:00 2001 From: eileencodes Date: Fri, 5 Aug 2016 09:58:43 -0400 Subject: Add skeleton for Rails::SystemTestCase This skelton is the bare minimum to get system tests to actually run in an application. This of course doesn't yet actually run a test but it is enough for `bin/rails test:system` to attempt to run files in `test/system` that inherit from `Rails::SystemTestCase`. --- actionpack/lib/system_test_case.rb | 5 +++++ railties/lib/rails/test_help.rb | 8 ++++++++ 2 files changed, 13 insertions(+) create mode 100644 actionpack/lib/system_test_case.rb diff --git a/actionpack/lib/system_test_case.rb b/actionpack/lib/system_test_case.rb new file mode 100644 index 0000000000..fdaae3ff40 --- /dev/null +++ b/actionpack/lib/system_test_case.rb @@ -0,0 +1,5 @@ +module Rails + class SystemTestCase < ActiveSupport::TestCase + include Rails.application.routes.url_helpers + end +end diff --git a/railties/lib/rails/test_help.rb b/railties/lib/rails/test_help.rb index 0f9bf98737..468b50c0f8 100644 --- a/railties/lib/rails/test_help.rb +++ b/railties/lib/rails/test_help.rb @@ -7,6 +7,7 @@ require "active_support/test_case" require "action_controller" require "action_controller/test_case" require "action_dispatch/testing/integration" +require 'system_test_case' require "rails/generators/test_case" require "active_support/testing/autorun" @@ -44,3 +45,10 @@ class ActionDispatch::IntegrationTest super end end + +class Rails::SystemTestCase + def before_setup # :nodoc: + @routes = Rails.application.routes + super + end +end -- cgit v1.2.3