aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/system_testing
diff options
context:
space:
mode:
authorEileen M. Uchitelle <eileencodes@users.noreply.github.com>2017-02-24 11:49:42 -0500
committerGitHub <noreply@github.com>2017-02-24 11:49:42 -0500
commit87b2b6c5124732ff709b8e1900a99ba0a08f6982 (patch)
tree74d84e1af6a375f59992a95c88801a54fe028bbb /actionpack/lib/action_dispatch/system_testing
parentaa56dc235a341876762f0219738cac46d181fcd3 (diff)
parent704853b58be60b307261da9b9990a4c87c68860e (diff)
downloadrails-87b2b6c5124732ff709b8e1900a99ba0a08f6982.tar.gz
rails-87b2b6c5124732ff709b8e1900a99ba0a08f6982.tar.bz2
rails-87b2b6c5124732ff709b8e1900a99ba0a08f6982.zip
Merge pull request #28144 from lucasmazza/lm-system-test-driven-by
Change `SystemTestCase.driven_by` to use `setup`/`teardown` hooks
Diffstat (limited to 'actionpack/lib/action_dispatch/system_testing')
-rw-r--r--actionpack/lib/action_dispatch/system_testing/browser.rb13
-rw-r--r--actionpack/lib/action_dispatch/system_testing/driver.rb12
2 files changed, 12 insertions, 13 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
diff --git a/actionpack/lib/action_dispatch/system_testing/driver.rb b/actionpack/lib/action_dispatch/system_testing/driver.rb
index 7c2ad84e19..8decb54419 100644
--- a/actionpack/lib/action_dispatch/system_testing/driver.rb
+++ b/actionpack/lib/action_dispatch/system_testing/driver.rb
@@ -5,14 +5,14 @@ module ActionDispatch
@name = name
end
- def run
- register
+ def use
+ @current = Capybara.current_driver
+ Capybara.current_driver = @name
end
- private
- def register
- Capybara.default_driver = @name
- end
+ def reset
+ Capybara.current_driver = @current
+ end
end
end
end