Skip to content

Commit cb4e222

Browse files
lfdebruxDavidBiddle
andcommitted
Rename unprocessable_entity to unprocessable_content
When the 422 status was initially proposed in [RFC4918](https://datatracker.ietf.org/doc/html/rfc4918) (2007), it was called 'Unprocessable entity'. When it became a standard in [RFC9110](https://datatracker.ietf.org/doc/html/rfc9110) (2022), it was renamed 'Unprocessable content'. Rack now supports it as `:unprocessable_content` and has deprecated `:unprocessable_entity`. This commit updates it to use the new name. Co-authored-by: David Biddle <david.biddle@digital.cabinet-office.gov.uk>
1 parent fcccfbc commit cb4e222

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

app/controllers/account/contact_for_research_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def update
1414
if @contact_for_research_input.submit
1515
redirect_to next_path
1616
else
17-
render :edit, status: :unprocessable_entity
17+
render :edit, status: :unprocessable_content
1818
end
1919
end
2020

spec/controllers/forms/copy_of_answers_controller_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@
9494
context "when the send_copy_of_answers value is invalid" do
9595
let(:send_copy_of_answers) { "invalid_value" }
9696

97-
it "renders the new template with unprocessable entity status" do
97+
it "renders the new template with unprocessable content status" do
9898
post(copy_of_answers_create_path(form_id: form.id), params:)
99-
expect(response).to have_http_status(:unprocessable_entity)
99+
expect(response).to have_http_status(:unprocessable_content)
100100
expect(response).to have_rendered :new
101101
expect(response.body).to include("Sorry, there was a problem. Please try again.")
102102
end

0 commit comments

Comments
 (0)