aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authoreileencodes <eileencodes@gmail.com>2016-08-27 16:47:24 -0400
committereileencodes <eileencodes@gmail.com>2017-02-20 15:07:32 -0500
commitfaba2505ddf6d0c2825cddcc0468a89232a9d8ae (patch)
treebe537379b1de6dd2581a1bb2c83949954054fe82 /actionpack
parent9edc998d2a5dcaa5898c11bef29c97403941cff5 (diff)
downloadrails-faba2505ddf6d0c2825cddcc0468a89232a9d8ae.tar.gz
rails-faba2505ddf6d0c2825cddcc0468a89232a9d8ae.tar.bz2
rails-faba2505ddf6d0c2825cddcc0468a89232a9d8ae.zip
Refactor to not include `capybara/rails`
Rails itself is not a Rails application so instead of including `capybara/rails` we should use the code in there to set up the test. The only reason capybara needs to include capybara/rails in the first place is because Rails didn't yet support it.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/system_testing/test_helper.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/actionpack/lib/system_testing/test_helper.rb b/actionpack/lib/system_testing/test_helper.rb
index bb68cfe665..bbf4e469ac 100644
--- a/actionpack/lib/system_testing/test_helper.rb
+++ b/actionpack/lib/system_testing/test_helper.rb
@@ -1,11 +1,22 @@
-require 'capybara/rails'
+require 'capybara/dsl'
require 'system_testing/test_helpers'
module SystemTesting
module TestHelper
- include Capybara::DSL
include TestHelpers::FormHelper
include TestHelpers::Assertions
+ include Capybara::DSL
+
+ Capybara.app = Rack::Builder.new do
+ map "/" do
+ run Rails.application
+ end
+ end
+
+ def before_setup
+ Base.driver.call
+ super
+ end
def after_teardown
Capybara.reset_sessions!