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 app/controllers/forms/check_your_answers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def submit_answers
unless email_confirmation_input.valid?
setup_check_your_answers

return render template: "forms/check_your_answers/show", locals: { email_confirmation_input: }, status: :unprocessable_entity
return render template: "forms/check_your_answers/show", locals: { email_confirmation_input: }, status: :unprocessable_content
end

return redirect_to error_repeat_submission_path(current_form.id) if current_context.form_submitted?
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/forms/page_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def save
redirect_post_save
else
setup_instance_vars_for_view
render :show, status: :unprocessable_entity
render :show, status: :unprocessable_content
end
end

Expand Down Expand Up @@ -152,7 +152,7 @@ def check_goto_page_routing_error
error_name: first_goto_error_name,
link_url: admin_edit_condition_url(@step.form_id, routes_page_id),
question_number: routes_page.page_number,
}, status: :unprocessable_entity
}, status: :unprocessable_content
end

def admin_edit_condition_url(form_id, page_id)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/forms/remove_answer_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def delete
@remove_input = RemoveInput.new(remove_input_params)

if @remove_input.invalid?
return render :show, status: :unprocessable_entity
return render :show, status: :unprocessable_content
end

if @remove_input.remove?
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/forms/remove_file_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def destroy

if @remove_input.invalid?
setup_urls
return render :show, status: :unprocessable_entity
return render :show, status: :unprocessable_content
end

if @remove_input.remove?
Expand Down
4 changes: 2 additions & 2 deletions spec/requests/forms/check_your_answers_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@
end

it "return 422 error code" do
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
end

it "renders the check your answers page" do
Expand All @@ -584,7 +584,7 @@
end

it "return 422 error code" do
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
end

it "renders the check your answers page" do
Expand Down
10 changes: 5 additions & 5 deletions spec/requests/forms/page_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@

it "returns a 422 response" do
get form_page_path(mode:, form_id: 2, form_slug: form_data.form_slug, page_slug: 1)
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
end

it "shows the error page" do
Expand Down Expand Up @@ -313,7 +313,7 @@

it "returns a 422 response" do
get form_page_path(mode:, form_id: 2, form_slug: form_data.form_slug, page_slug: 4)
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
end

it "shows the error page" do
Expand All @@ -331,7 +331,7 @@

it "returns a 422 response" do
get form_page_path(mode:, form_id: 2, form_slug: form_data.form_slug, page_slug: 1)
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
end

it "shows the error page" do
Expand Down Expand Up @@ -426,7 +426,7 @@
end

it "returns 422" do
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
end

it "adds validation_errors logging attribute" do
Expand Down Expand Up @@ -601,7 +601,7 @@

it "returns a 422 response" do
post save_form_page_path(mode:, form_id: 2, form_slug: form_data.form_slug, page_slug: 1), params: { question: { selection: "Option 2" }, changing_existing_answer: false }
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
end

it "shows the error page" do
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/forms/remove_answer_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
it "renders the show template" do
delete "/preview-draft/#{form.id}/#{form.form_slug}/#{first_step_in_form.id}/1/remove", params: { remove_input: { remove: } }
expect(response).to render_template(:show)
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/requests/forms/remove_file_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@

it "renders the remove file page with 422 status" do
expect(response).to render_template("forms/remove_file/show")
expect(response).to have_http_status :unprocessable_entity
expect(response).to have_http_status :unprocessable_content
end

it "displays an error" do
Expand Down
Loading