From fb85d76ac7b806929c7a96fd0b75207d2b80e102 Mon Sep 17 00:00:00 2001 From: James Mead Date: Mon, 11 Aug 2025 09:51:19 +0100 Subject: [PATCH] Fix unprocessable entity deprecation warning I'm seeing this deprecation when using newer versions of `rack` with request specs that use the `have_http_status` matcher [1] from newer versions (v8?) of `rspec-rails`. Status code :unprocessable_entity is deprecated and will be removed in a future version of Rack. Please use :unprocessable_content instead. The `:unprocessable_entity` symbol was deprecated in `rack` in this commit [2] which was released in `rack` v3.1.0 [3]. [1]: https://rspec.info/features/8-0/rspec-rails/matchers/have-http-status-matcher/ [2]: https://github.com/rack/rack/pull/2137 [3]: https://github.com/rack/rack/blob/ee7ac5a1db5bc5c65e4b83342b8f4df88ef3c075/CHANGELOG.md#310---2024-06-11 --- Gemfile.lock | 8 ++++---- app/controllers/administrate/application_controller.rb | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index a86448910..1ce031923 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -306,10 +306,10 @@ GEM rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-rails (7.1.0) - actionpack (>= 7.0) - activesupport (>= 7.0) - railties (>= 7.0) + rspec-rails (8.0.1) + actionpack (>= 7.2) + activesupport (>= 7.2) + railties (>= 7.2) rspec-core (~> 3.13) rspec-expectations (~> 3.13) rspec-mocks (~> 3.13) diff --git a/app/controllers/administrate/application_controller.rb b/app/controllers/administrate/application_controller.rb index 3de6132ba..eed8a81db 100644 --- a/app/controllers/administrate/application_controller.rb +++ b/app/controllers/administrate/application_controller.rb @@ -54,7 +54,7 @@ def create else render :new, locals: { page: Administrate::Page::Form.new(dashboard, resource) - }, status: :unprocessable_entity + }, status: :unprocessable_content end end @@ -68,7 +68,7 @@ def update else render :edit, locals: { page: Administrate::Page::Form.new(dashboard, requested_resource) - }, status: :unprocessable_entity + }, status: :unprocessable_content end end