Skip to content

Commit fb85d76

Browse files
committed
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]: rack/rack#2137 [3]: https://github.com/rack/rack/blob/ee7ac5a1db5bc5c65e4b83342b8f4df88ef3c075/CHANGELOG.md#310---2024-06-11
1 parent 7993d8a commit fb85d76

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Gemfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,10 @@ GEM
306306
rspec-mocks (3.13.2)
307307
diff-lcs (>= 1.2.0, < 2.0)
308308
rspec-support (~> 3.13.0)
309-
rspec-rails (7.1.0)
310-
actionpack (>= 7.0)
311-
activesupport (>= 7.0)
312-
railties (>= 7.0)
309+
rspec-rails (8.0.1)
310+
actionpack (>= 7.2)
311+
activesupport (>= 7.2)
312+
railties (>= 7.2)
313313
rspec-core (~> 3.13)
314314
rspec-expectations (~> 3.13)
315315
rspec-mocks (~> 3.13)

app/controllers/administrate/application_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def create
5454
else
5555
render :new, locals: {
5656
page: Administrate::Page::Form.new(dashboard, resource)
57-
}, status: :unprocessable_entity
57+
}, status: :unprocessable_content
5858
end
5959
end
6060

@@ -68,7 +68,7 @@ def update
6868
else
6969
render :edit, locals: {
7070
page: Administrate::Page::Form.new(dashboard, requested_resource)
71-
}, status: :unprocessable_entity
71+
}, status: :unprocessable_content
7272
end
7373
end
7474

0 commit comments

Comments
 (0)