Skip to content

Commit

Permalink
Merge branch 'main' into skip-test-db-truncate-flag
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh committed May 7, 2024
2 parents 8dc555e + 9ad3685 commit 2d46405
Show file tree
Hide file tree
Showing 201 changed files with 1,678 additions and 2,526 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/devcontainer-smoke-test.yml
Expand Up @@ -15,10 +15,10 @@ jobs:

steps:
- name: Checkout (GitHub)
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -10,6 +10,7 @@
/doc/
/guides/output/
/preview/
preview.tar.gz
Brewfile.lock.json
debug.log*
node_modules/
Expand Down
16 changes: 8 additions & 8 deletions Gemfile.lock
Expand Up @@ -112,7 +112,7 @@ PATH
railties (7.2.0.alpha)
actionpack (= 7.2.0.alpha)
activesupport (= 7.2.0.alpha)
irb
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
Expand Down Expand Up @@ -288,10 +288,10 @@ GEM
actionpack (>= 6.0.0)
activesupport (>= 6.0.0)
railties (>= 6.0.0)
io-console (0.7.1)
irb (1.11.0)
rdoc
reline (>= 0.3.8)
io-console (0.7.2)
irb (1.13.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
Expand Down Expand Up @@ -377,7 +377,7 @@ GEM
path_expander (1.1.1)
pg (1.5.4)
prettier_print (1.2.1)
prism (0.19.0)
prism (0.27.0)
propshaft (0.8.0)
actionpack (>= 7.0.0)
activesupport (>= 7.0.0)
Expand Down Expand Up @@ -415,7 +415,7 @@ GEM
rb-inotify (0.10.1)
ffi (~> 1.0)
rbtree (0.4.6)
rdoc (6.6.2)
rdoc (6.6.3.1)
psych (>= 4.0.0)
redcarpet (3.2.3)
redis (5.0.8)
Expand All @@ -425,7 +425,7 @@ GEM
redis-namespace (1.11.0)
redis (>= 4)
regexp_parser (2.8.3)
reline (0.4.1)
reline (0.5.4)
io-console (~> 0.5)
representable (3.2.0)
declarative (< 0.1.0)
Expand Down
8 changes: 5 additions & 3 deletions actionpack/test/controller/action_pack_assertions_test.rb
Expand Up @@ -177,9 +177,11 @@ def test_get_post_request_switch
end

def test_string_constraint
with_routing do |set|
set.draw do
get "photos", to: "action_pack_assertions#nothing", constraints: { subdomain: "admin" }
assert_nothing_raised do
with_routing do |set|
set.draw do
get "photos", to: "action_pack_assertions#nothing", constraints: { subdomain: "admin" }
end
end
end
end
Expand Down
8 changes: 6 additions & 2 deletions actionpack/test/controller/flash_test.rb
Expand Up @@ -310,15 +310,19 @@ def test_setting_flash_does_not_raise_in_following_requests
with_test_route_set do
env = { "action_dispatch.request.flash_hash" => ActionDispatch::Flash::FlashHash.new }
get "/set_flash", env: env
get "/set_flash", env: env
assert_nothing_raised do
get "/set_flash", env: env
end
end
end

def test_setting_flash_now_does_not_raise_in_following_requests
with_test_route_set do
env = { "action_dispatch.request.flash_hash" => ActionDispatch::Flash::FlashHash.new }
get "/set_flash_now", env: env
get "/set_flash_now", env: env
assert_nothing_raised do
get "/set_flash_now", env: env
end
end
end

Expand Down
1 change: 1 addition & 0 deletions actionpack/test/controller/live_stream_test.rb
Expand Up @@ -430,6 +430,7 @@ def test_delayed_autoload_after_write_within_interlock_hook
res = get :write_sleep_autoload
res.each { }
ActiveSupport::Dependencies.interlock.done_running
pass
end

def test_async_stream
Expand Down
1 change: 1 addition & 0 deletions actionpack/test/controller/render_test.rb
Expand Up @@ -1000,6 +1000,7 @@ def test_live_head_ok

@response.stream.on_error { flunk "action should not raise any errors" }
sleep 0.2
pass
end
end

Expand Down
8 changes: 5 additions & 3 deletions actionpack/test/controller/routing_test.rb
Expand Up @@ -508,9 +508,11 @@ def setup_for_named_route(options = {})
end

def test_named_route_without_hash
rs.draw do
ActionDispatch.deprecator.silence do
get ":controller/:action/:id", as: "normal"
assert_nothing_raised do
rs.draw do
ActionDispatch.deprecator.silence do
get ":controller/:action/:id", as: "normal"
end
end
end
end
Expand Down
4 changes: 3 additions & 1 deletion actionpack/test/dispatch/mapper_test.rb
Expand Up @@ -36,7 +36,9 @@ def asts
end

def test_initialize
Mapper.new FakeSet.new
assert_nothing_raised do
Mapper.new FakeSet.new
end
end

def test_scope_raises_on_anchor
Expand Down
Expand Up @@ -159,6 +159,7 @@ def teardown
fixture = FIXTURE_PATH + "/ruby_on_rails.jpg"
params = { uploaded_data: fixture_file_upload(fixture, "image/jpeg") }
post "/read", params: params
assert_equal Encoding::ASCII_8BIT, response.body.encoding
end
end

Expand Down
8 changes: 6 additions & 2 deletions actionpack/test/dispatch/request_test.rb
Expand Up @@ -1152,7 +1152,9 @@ class RequestParameters < BaseRequestTest
request = stub_request("QUERY_STRING" => "foo=%81E")

ActionDispatch::Request::Utils.stub(:set_binary_encoding, { "foo" => "\x81E".b }) do
request.parameters
assert_nothing_raised do
request.parameters
end
end
end

Expand All @@ -1166,7 +1168,9 @@ class RequestParameters < BaseRequestTest
)

ActionDispatch::Request::Utils.stub(:set_binary_encoding, { "foo" => "\x81E".b }) do
request.parameters
assert_nothing_raised do
request.parameters
end
end
end

Expand Down
12 changes: 8 additions & 4 deletions actionpack/test/dispatch/system_testing/driver_test.rb
Expand Up @@ -30,8 +30,10 @@ class DriverTest < ActiveSupport::TestCase

test "initializing the driver with a headless chrome and custom path" do
original_driver_path = ::Selenium::WebDriver::Chrome::Service.driver_path
::Selenium::WebDriver::Chrome::Service.driver_path = "bin/test"
ActionDispatch::SystemTesting::Driver.new(:selenium, using: :headless_chrome, screen_size: [1400, 1400])
assert_nothing_raised do
::Selenium::WebDriver::Chrome::Service.driver_path = "bin/test"
ActionDispatch::SystemTesting::Driver.new(:selenium, using: :headless_chrome, screen_size: [1400, 1400])
end
ensure
::Selenium::WebDriver::Chrome::Service.driver_path = original_driver_path
end
Expand All @@ -47,8 +49,10 @@ class DriverTest < ActiveSupport::TestCase

test "initializing the driver with a headless firefox and custom path" do
original_driver_path = ::Selenium::WebDriver::Firefox::Service.driver_path
::Selenium::WebDriver::Firefox::Service.driver_path = "bin/test"
ActionDispatch::SystemTesting::Driver.new(:selenium, using: :headless_firefox, screen_size: [1400, 1400])
assert_nothing_raised do
::Selenium::WebDriver::Firefox::Service.driver_path = "bin/test"
ActionDispatch::SystemTesting::Driver.new(:selenium, using: :headless_firefox, screen_size: [1400, 1400])
end
ensure
::Selenium::WebDriver::Firefox::Service.driver_path = original_driver_path
end
Expand Down
Expand Up @@ -62,7 +62,12 @@ def create_actiontext_files
def enable_image_processing_gem
if (gemfile_path = Pathname(destination_root).join("Gemfile")).exist?
say "Ensure image_processing gem has been enabled so image uploads will work (remember to bundle!)"
uncomment_lines gemfile_path, /gem "image_processing"/
image_processing_regex = /gem ["']image_processing["']/
if File.readlines(gemfile_path).grep(image_processing_regex).any?
uncomment_lines gemfile_path, image_processing_regex
else
run "bundle add --skip-install image_processing"
end
end
end

Expand Down
8 changes: 6 additions & 2 deletions actiontext/test/unit/strict_loading_test.rb
Expand Up @@ -28,14 +28,18 @@ class MessageWithFooter < MessageWithStrictLoading

records = MessageWithStrictLoading.with_rich_text_strict_loading_content.all

records.map(&:strict_loading_content)
assert_nothing_raised do
records.map(&:strict_loading_content)
end
end

test "has_rich_text accepts strict_loading: overrides" do
MessageWithFooter.create! footer: "ignored"

records = MessageWithFooter.all

records.map(&:footer)
assert_nothing_raised do
records.map(&:footer)
end
end
end

0 comments on commit 2d46405

Please sign in to comment.