Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.4
4.0.10
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ruby 4.0.4
ruby 4.0.10
nodejs 24.18.0
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
FROM ruby:4.0.4
FROM ruby:4.0.10

RUN dpkg --add-architecture i386 \
&& apt-get update -qq \
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ DEPENDENCIES
wkhtmltopdf-binary (= 0.12.3.1)

RUBY VERSION
ruby 4.0.4
ruby 4.0.10

BUNDLED WITH
4.0.15
2 changes: 1 addition & 1 deletion Gemfile.next.lock
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ DEPENDENCIES
wkhtmltopdf-binary (= 0.12.3.1)

RUBY VERSION
ruby 4.0.4
ruby 4.0.10

BUNDLED WITH
4.0.15
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ You can see it working in https://audit.fastruby.io

## Requirements

- Ruby version `4.0.4` (see `.ruby-version` / `.tool-versions`)
- Ruby version `4.0.10` (see `.ruby-version` / `.tool-versions`)
- Node version `24.18.0` (see `.tool-versions`)
- Docker + Docker Compose (recommended for local development)

Expand Down
35 changes: 35 additions & 0 deletions test/application_system_test_case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,41 @@
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options, service: service)
end

# Capybara 3.40.0 clears storage with `origin: "*"`, which recent Chrome
# rejects. Clear the app server's origin instead. The version guard turns this
# off once a Capybara release with the fix is installed.
# https://github.com/teamcapybara/capybara/pull/2867
# https://github.com/teamcapybara/capybara/pull/2868
if Gem::Version.new(Capybara::VERSION) <= Gem::Version.new("3.40.0")
Capybara::Selenium::Driver::ChromeDriver.class_eval do
# Mirrors Capybara's upstream reset!, so keep its shape rather than splitting it up.
# :reek:TooManyStatements
def reset!
# Use instance variable directly so we avoid starting the browser just to reset the session
return unless @browser

switch_to_window(window_handles.first)
window_handles.slice(1..).each { |win| close_window(win) }
return super if chromedriver_version < 73

timer = Capybara::Helpers.timer(expire_in: 10)
begin
clear_storage unless uniform_storage_clear?
@browser.navigate.to('about:blank')
wait_for_empty_page(timer)
rescue *unhandled_alert_errors
accept_unhandled_reset_alert
retry
end

# base_url includes the random port Capybara's server listens on, which
# Storage.clearDataForOrigin needs to match the app's storage.
origin = Capybara.current_session.server&.base_url
execute_cdp('Storage.clearDataForOrigin', origin: origin, storageTypes: storage_types_to_clear) if origin
end
end
end

class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
driven_by :headless_chromium
end
Loading