From 5936bd9a201a2c1a3730d9c857f0908959505d2b Mon Sep 17 00:00:00 2001 From: Edouard CHIN Date: Wed, 4 Apr 2018 13:29:50 -0400 Subject: driver_option -> driver_options --- actionpack/CHANGELOG.md | 3 ++- actionpack/lib/action_dispatch/system_testing/browser.rb | 8 ++++---- actionpack/lib/action_dispatch/system_testing/driver.rb | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index 024e03ad7a..d9041aecb7 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -1,4 +1,5 @@ -* `ActionDispatch::SystemTestCase.driven_by` can now be called with a block to define specific browser capabilities. +* `ActionDispatch::SystemTestCase.driven_by` can now be called with a block + to define specific browser capabilities. *Edouard Chin* diff --git a/actionpack/lib/action_dispatch/system_testing/browser.rb b/actionpack/lib/action_dispatch/system_testing/browser.rb index 9361b165ff..74585062aa 100644 --- a/actionpack/lib/action_dispatch/system_testing/browser.rb +++ b/actionpack/lib/action_dispatch/system_testing/browser.rb @@ -29,7 +29,7 @@ module ActionDispatch end end - def driver_option + def driver_options @option ||= case type when :chrome Selenium::WebDriver::Chrome::Options.new @@ -43,13 +43,13 @@ module ActionDispatch driver_option.args << "--headless" driver_option.args << "--disable-gpu" if Gem.win_platform? - driver_option + driver_options end def headless_firefox_browser_options - driver_option.args << "-headless" + driver_options.args << "-headless" - driver_option + driver_options end end end diff --git a/actionpack/lib/action_dispatch/system_testing/driver.rb b/actionpack/lib/action_dispatch/system_testing/driver.rb index 87b72a2048..f71736833c 100644 --- a/actionpack/lib/action_dispatch/system_testing/driver.rb +++ b/actionpack/lib/action_dispatch/system_testing/driver.rb @@ -23,7 +23,7 @@ module ActionDispatch end def register - define_browser_capabilities(@browser.driver_option) + define_browser_capabilities(@browser.driver_options) Capybara.register_driver @name do |app| case @name @@ -34,8 +34,8 @@ module ActionDispatch end end - def define_browser_capabilities(driver_option) - @desired_capabilities.call(driver_option) if @desired_capabilities + def define_browser_capabilities(driver_options) + @desired_capabilities.call(driver_options) if @desired_capabilities end def browser_options -- cgit v1.2.3