aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/system_testing/browser.rb
diff options
context:
space:
mode:
authorLucas Mazza <lucastmazza@gmail.com>2017-02-23 22:48:12 -0300
committerLucas Mazza <lucastmazza@gmail.com>2017-02-24 13:22:22 -0300
commit704853b58be60b307261da9b9990a4c87c68860e (patch)
treec5d4a6fa67a50a6f4427679701794adb6b68061e /actionpack/lib/action_dispatch/system_testing/browser.rb
parent4ed704740b7ccc8ac9cfb7b5ec62d55ac178ec97 (diff)
downloadrails-704853b58be60b307261da9b9990a4c87c68860e.tar.gz
rails-704853b58be60b307261da9b9990a4c87c68860e.tar.bz2
rails-704853b58be60b307261da9b9990a4c87c68860e.zip
Change `SystemTestCase.driven_by` to use `setup`/`teardown` hooks
Previously, `driven_by` would change the Capybara configuration when the test case is loaded, and having multiple test classes with different `driven_by` configs would fail as the last loaded would be effective.
Diffstat (limited to 'actionpack/lib/action_dispatch/system_testing/browser.rb')
-rw-r--r--actionpack/lib/action_dispatch/system_testing/browser.rb13
1 files changed, 6 insertions, 7 deletions
diff --git a/actionpack/lib/action_dispatch/system_testing/browser.rb b/actionpack/lib/action_dispatch/system_testing/browser.rb
index c9a6628516..14ea06459d 100644
--- a/actionpack/lib/action_dispatch/system_testing/browser.rb
+++ b/actionpack/lib/action_dispatch/system_testing/browser.rb
@@ -1,14 +1,17 @@
+require "action_dispatch/system_testing/driver"
+
module ActionDispatch
module SystemTesting
- class Browser # :nodoc:
+ class Browser < Driver # :nodoc:
def initialize(name, screen_size)
+ super(name)
@name = name
@screen_size = screen_size
end
- def run
+ def use
register
- setup
+ super
end
private
@@ -19,10 +22,6 @@ module ActionDispatch
end
end
end
-
- def setup
- Capybara.default_driver = @name.to_sym
- end
end
end
end