summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/support/capybara.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb
index e0fb4b83229..9ddcc5f2fbf 100644
--- a/spec/support/capybara.rb
+++ b/spec/support/capybara.rb
@@ -84,7 +84,7 @@ RSpec.configure do |config|
config.after(:example, :js) do |example|
# when a test fails, display any messages in the browser's console
if example.exception
- console = page.driver.browser.manage.logs.get(:browser).try(:reject) { |log| log.message =~ JS_CONSOLE_FILTER }
+ console = page.driver.browser.manage.logs.get(:browser)&.reject { |log| log.message =~ JS_CONSOLE_FILTER }
if console.present?
message = "Unexpected browser console output:\n" + console.map(&:message).join("\n")
raise JSConsoleError, message