From 773f24a6322617de00c9d7fa0b1625893df55366 Mon Sep 17 00:00:00 2001 From: Budmin Date: Mon, 22 Dec 2025 14:49:16 -0500 Subject: [PATCH] replaced :unprocessable_entity with :unprocessable_content --- .../additional_expenses_controller.rb | 2 +- .../all_casa_admins/casa_admins_controller.rb | 8 ++++---- .../all_casa_admins/casa_orgs_controller.rb | 4 ++-- .../all_casa_admins/patch_notes_controller.rb | 6 +++--- app/controllers/all_casa_admins_controller.rb | 12 ++++++------ app/controllers/banners_controller.rb | 4 ++-- app/controllers/bulk_court_dates_controller.rb | 4 ++-- app/controllers/casa_admins_controller.rb | 16 ++++++++-------- app/controllers/casa_cases_controller.rb | 16 ++++++++-------- app/controllers/casa_org_controller.rb | 4 ++-- app/controllers/case_assignments_controller.rb | 6 +++--- app/controllers/case_contacts/form_controller.rb | 2 +- app/controllers/case_court_reports_controller.rb | 2 +- app/controllers/case_groups_controller.rb | 4 ++-- app/controllers/checklist_items_controller.rb | 4 ++-- .../contact_topic_answers_controller.rb | 2 +- app/controllers/contact_topics_controller.rb | 6 +++--- .../contact_type_groups_controller.rb | 4 ++-- app/controllers/contact_types_controller.rb | 4 ++-- app/controllers/court_dates_controller.rb | 4 ++-- app/controllers/custom_org_links_controller.rb | 4 ++-- app/controllers/fund_requests_controller.rb | 2 +- app/controllers/hearing_types_controller.rb | 4 ++-- app/controllers/judges_controller.rb | 4 ++-- app/controllers/languages_controller.rb | 4 ++-- .../learning_hour_topics_controller.rb | 4 ++-- .../learning_hour_types_controller.rb | 4 ++-- app/controllers/learning_hours_controller.rb | 4 ++-- app/controllers/mileage_rates_controller.rb | 4 ++-- app/controllers/other_duties_controller.rb | 4 ++-- app/controllers/placement_types_controller.rb | 4 ++-- app/controllers/placements_controller.rb | 6 +++--- app/controllers/supervisors_controller.rb | 4 ++-- app/controllers/users_controller.rb | 14 +++++++------- app/controllers/volunteers_controller.rb | 8 ++++---- spec/requests/additional_expenses_spec.rb | 2 +- .../requests/all_casa_admins/casa_admins_spec.rb | 8 ++++---- spec/requests/all_casa_admins/casa_orgs_spec.rb | 2 +- .../requests/all_casa_admins/patch_notes_spec.rb | 4 ++-- spec/requests/all_casa_admins_spec.rb | 12 ++++++------ spec/requests/casa_admins_spec.rb | 8 ++++---- spec/requests/casa_cases_spec.rb | 14 +++++++------- spec/requests/casa_org_spec.rb | 4 ++-- spec/requests/case_contacts/form_spec.rb | 4 ++-- spec/requests/case_court_reports_spec.rb | 2 +- spec/requests/case_groups_spec.rb | 4 ++-- spec/requests/contact_topic_answers_spec.rb | 2 +- spec/requests/contact_topics_spec.rb | 4 ++-- spec/requests/court_dates_spec.rb | 4 ++-- spec/requests/fund_requests_spec.rb | 2 +- spec/requests/mileage_rates_spec.rb | 6 +++--- spec/requests/other_duties_spec.rb | 4 ++-- spec/requests/supervisors_spec.rb | 2 +- spec/requests/users_spec.rb | 4 ++-- spec/requests/volunteers_spec.rb | 4 ++-- 55 files changed, 142 insertions(+), 142 deletions(-) diff --git a/app/controllers/additional_expenses_controller.rb b/app/controllers/additional_expenses_controller.rb index 49ee7a6316..be8c928ce8 100644 --- a/app/controllers/additional_expenses_controller.rb +++ b/app/controllers/additional_expenses_controller.rb @@ -8,7 +8,7 @@ def create if @additional_expense.save render json: @additional_expense.as_json, status: :created else - render json: @additional_expense.errors.as_json, status: :unprocessable_entity + render json: @additional_expense.errors.as_json, status: :unprocessable_content end end diff --git a/app/controllers/all_casa_admins/casa_admins_controller.rb b/app/controllers/all_casa_admins/casa_admins_controller.rb index 5b39683104..033b6d57b7 100644 --- a/app/controllers/all_casa_admins/casa_admins_controller.rb +++ b/app/controllers/all_casa_admins/casa_admins_controller.rb @@ -12,7 +12,7 @@ def create service.create! redirect_to all_casa_admins_casa_org_path(@casa_org), notice: "New admin created successfully" rescue ActiveRecord::RecordInvalid - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -28,7 +28,7 @@ def update @casa_admin.filter_old_emails!(@casa_admin.email) redirect_to edit_all_casa_admins_casa_org_casa_admin_path(@casa_org), notice: notice else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end @@ -39,7 +39,7 @@ def activate redirect_to edit_all_casa_admins_casa_org_casa_admin_path, notice: "Admin was activated. They have been sent an email." else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end @@ -50,7 +50,7 @@ def deactivate redirect_to edit_all_casa_admins_casa_org_casa_admin_path, notice: "Admin was deactivated." else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end diff --git a/app/controllers/all_casa_admins/casa_orgs_controller.rb b/app/controllers/all_casa_admins/casa_orgs_controller.rb index cc1faf8565..878bbfcb15 100644 --- a/app/controllers/all_casa_admins/casa_orgs_controller.rb +++ b/app/controllers/all_casa_admins/casa_orgs_controller.rb @@ -25,8 +25,8 @@ def create end else respond_to do |format| - format.html { render :new, status: :unprocessable_entity } - format.json { render json: @casa_org.errors.full_messages, status: :unprocessable_entity } + format.html { render :new, status: :unprocessable_content } + format.json { render json: @casa_org.errors.full_messages, status: :unprocessable_content } end end end diff --git a/app/controllers/all_casa_admins/patch_notes_controller.rb b/app/controllers/all_casa_admins/patch_notes_controller.rb index f6783a0c8d..1dc35295f2 100644 --- a/app/controllers/all_casa_admins/patch_notes_controller.rb +++ b/app/controllers/all_casa_admins/patch_notes_controller.rb @@ -13,7 +13,7 @@ def create if @patch_note.save render json: {status: :created, id: @patch_note.id}, status: :created else - render json: {errors: @patch_note.errors.full_messages.to_json}, status: :unprocessable_entity + render json: {errors: @patch_note.errors.full_messages.to_json}, status: :unprocessable_content end end @@ -23,7 +23,7 @@ def update if @patch_note.update(patch_note_params) render json: {status: :ok} else - render json: {errors: @patch_note.errors.full_messages.to_json}, status: :unprocessable_entity + render json: {errors: @patch_note.errors.full_messages.to_json}, status: :unprocessable_content end end @@ -34,7 +34,7 @@ def destroy if @patch_note.destroy render json: {status: :ok} else - render json: {errors: @patch_note.errors.full_messages.to_json}, status: :unprocessable_entity + render json: {errors: @patch_note.errors.full_messages.to_json}, status: :unprocessable_content end end diff --git a/app/controllers/all_casa_admins_controller.rb b/app/controllers/all_casa_admins_controller.rb index b8918314e5..93a462abd5 100644 --- a/app/controllers/all_casa_admins_controller.rb +++ b/app/controllers/all_casa_admins_controller.rb @@ -30,10 +30,10 @@ def create end rescue ActiveRecord::RecordInvalid respond_to do |format| - format.html { render :new, status: :unprocessable_entity } + format.html { render :new, status: :unprocessable_content } format.json do - render json: @all_casa_admin.errors.full_messages, status: :unprocessable_entity + render json: @all_casa_admin.errors.full_messages, status: :unprocessable_content end end end @@ -53,8 +53,8 @@ def update end else respond_to do |format| - format.html { render :edit, status: :unprocessable_entity } - format.json { render json: @user.errors.full_messages, status: :unprocessable_entity } + format.html { render :edit, status: :unprocessable_content } + format.json { render json: @user.errors.full_messages, status: :unprocessable_content } end end end @@ -78,8 +78,8 @@ def update_password end else respond_to do |format| - format.html { render :edit, status: :unprocessable_entity } - format.json { render json: @user.errors.full_messages, status: :unprocessable_entity } + format.html { render :edit, status: :unprocessable_content } + format.json { render json: @user.errors.full_messages, status: :unprocessable_content } end end end diff --git a/app/controllers/banners_controller.rb b/app/controllers/banners_controller.rb index 46dc68ba5e..613d0126bc 100644 --- a/app/controllers/banners_controller.rb +++ b/app/controllers/banners_controller.rb @@ -35,7 +35,7 @@ def create redirect_to banners_path rescue - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end def update @@ -48,7 +48,7 @@ def update redirect_to banners_path rescue - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end def destroy diff --git a/app/controllers/bulk_court_dates_controller.rb b/app/controllers/bulk_court_dates_controller.rb index 3486102816..cd9848c6df 100644 --- a/app/controllers/bulk_court_dates_controller.rb +++ b/app/controllers/bulk_court_dates_controller.rb @@ -15,7 +15,7 @@ def create case_group_id = params[:court_date][:case_group_id] if case_group_id.empty? @court_date = build_court_date_with_error_message - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content return end @@ -26,7 +26,7 @@ def create if court_date_with_error @court_date = court_date_with_error - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content else redirect_to new_bulk_court_date_path, notice: "#{court_dates.size} #{"court date".pluralize(court_dates.size)} created!" end diff --git a/app/controllers/casa_admins_controller.rb b/app/controllers/casa_admins_controller.rb index 39fa8acf89..5cfa6cc309 100644 --- a/app/controllers/casa_admins_controller.rb +++ b/app/controllers/casa_admins_controller.rb @@ -26,8 +26,8 @@ def update end else respond_to do |format| - format.html { render :edit, status: :unprocessable_entity } - format.json { render json: @casa_admin.errors.full_messages, status: :unprocessable_entity } + format.html { render :edit, status: :unprocessable_content } + format.json { render json: @casa_admin.errors.full_messages, status: :unprocessable_content } end end end @@ -59,8 +59,8 @@ def create end rescue ActiveRecord::RecordInvalid respond_to do |format| - format.html { render :new, status: :unprocessable_entity } - format.json { render json: service.casa_admin.errors.full_messages, status: :unprocessable_entity } + format.html { render :new, status: :unprocessable_content } + format.json { render json: service.casa_admin.errors.full_messages, status: :unprocessable_content } end end end @@ -81,8 +81,8 @@ def activate end else respond_to do |format| - format.html { render :edit, status: :unprocessable_entity } - format.json { render json: @casa_admin.errors.full_messages, status: :unprocessable_entity } + format.html { render :edit, status: :unprocessable_content } + format.json { render json: @casa_admin.errors.full_messages, status: :unprocessable_content } end end rescue Errno::ECONNREFUSED => error @@ -100,8 +100,8 @@ def deactivate end else respond_to do |format| - format.html { render :edit, status: :unprocessable_entity } - format.json { render json: @casa_admin.errors.full_messages, status: :unprocessable_entity } + format.html { render :edit, status: :unprocessable_content } + format.json { render json: @casa_admin.errors.full_messages, status: :unprocessable_content } end end rescue Errno::ECONNREFUSED => error diff --git a/app/controllers/casa_cases_controller.rb b/app/controllers/casa_cases_controller.rb index c3b059a31d..4f07a8099e 100644 --- a/app/controllers/casa_cases_controller.rb +++ b/app/controllers/casa_cases_controller.rb @@ -59,8 +59,8 @@ def create set_contact_types @empty_court_date = court_date_unknown? respond_to do |format| - format.html { render :new, status: :unprocessable_entity } - format.json { render json: @casa_case.errors.full_messages, status: :unprocessable_entity } + format.html { render :new, status: :unprocessable_content } + format.json { render json: @casa_case.errors.full_messages, status: :unprocessable_content } end end end @@ -79,8 +79,8 @@ def update end else respond_to do |format| - format.html { render :edit, status: :unprocessable_entity } - format.json { render json: @casa_case.errors.full_messages, status: :unprocessable_entity } + format.html { render :edit, status: :unprocessable_content } + format.json { render json: @casa_case.errors.full_messages, status: :unprocessable_content } end end end @@ -101,8 +101,8 @@ def deactivate end else respond_to do |format| - format.html { render :edit, status: :unprocessable_entity } - format.json { render json: @casa_case.errors.full_messages, status: :unprocessable_entity } + format.html { render :edit, status: :unprocessable_content } + format.json { render json: @casa_case.errors.full_messages, status: :unprocessable_content } end end end @@ -123,8 +123,8 @@ def reactivate end else respond_to do |format| - format.html { render :edit, status: :unprocessable_entity } - format.json { render json: @casa_case.errors.full_messages, status: :unprocessable_entity } + format.html { render :edit, status: :unprocessable_content } + format.json { render json: @casa_case.errors.full_messages, status: :unprocessable_content } end end end diff --git a/app/controllers/casa_org_controller.rb b/app/controllers/casa_org_controller.rb index f1f1dce8b3..010dc1dfa7 100644 --- a/app/controllers/casa_org_controller.rb +++ b/app/controllers/casa_org_controller.rb @@ -30,8 +30,8 @@ def update end else respond_to do |format| - format.html { render :edit, status: :unprocessable_entity } - format.json { render json: @casa_org.errors.full_messages, status: :unprocessable_entity } + format.html { render :edit, status: :unprocessable_content } + format.json { render json: @casa_org.errors.full_messages, status: :unprocessable_content } end end end diff --git a/app/controllers/case_assignments_controller.rb b/app/controllers/case_assignments_controller.rb index 4737f0fc0c..62e4743d63 100644 --- a/app/controllers/case_assignments_controller.rb +++ b/app/controllers/case_assignments_controller.rb @@ -53,8 +53,8 @@ def unassign end else respond_to do |format| - format.html { render :edit, status: :unprocessable_entity } - format.json { render json: @case_assignment.errors.full_messages, status: :unprocessable_entity } + format.html { render :edit, status: :unprocessable_content } + format.json { render json: @case_assignment.errors.full_messages, status: :unprocessable_content } end end end @@ -133,6 +133,6 @@ def handle_successful_assignment(msg) def handle_failed_assignment(msg) @message = msg flash.alert = msg - @status = :unprocessable_entity + @status = :unprocessable_content end end diff --git a/app/controllers/case_contacts/form_controller.rb b/app/controllers/case_contacts/form_controller.rb index b0877a276f..0dc2437331 100644 --- a/app/controllers/case_contacts/form_controller.rb +++ b/app/controllers/case_contacts/form_controller.rb @@ -35,7 +35,7 @@ def update if @case_contact.update(case_contact_params) render json: @case_contact, status: :ok else - render json: @case_contact.errors.full_messages, status: :unprocessable_entity + render json: @case_contact.errors.full_messages, status: :unprocessable_content end end end diff --git a/app/controllers/case_court_reports_controller.rb b/app/controllers/case_court_reports_controller.rb index faad8da236..81484266c0 100644 --- a/app/controllers/case_court_reports_controller.rb +++ b/app/controllers/case_court_reports_controller.rb @@ -49,7 +49,7 @@ def generate render json: {status: :not_found, error_messages: error_messages}, status: :not_found rescue => e error_messages = generate_error(e.to_s) - render json: {status: :unprocessable_entity, error_messages: error_messages}, status: :unprocessable_entity + render json: {status: :unprocessable_content, error_messages: error_messages}, status: :unprocessable_content end private diff --git a/app/controllers/case_groups_controller.rb b/app/controllers/case_groups_controller.rb index c47428bd6d..2a9c06e684 100644 --- a/app/controllers/case_groups_controller.rb +++ b/app/controllers/case_groups_controller.rb @@ -23,7 +23,7 @@ def create if @case_group.save redirect_to case_groups_path, notice: "Case group created!" else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -33,7 +33,7 @@ def update if @case_group.update(case_group_params) redirect_to case_groups_path, notice: "Case group updated!" else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end diff --git a/app/controllers/checklist_items_controller.rb b/app/controllers/checklist_items_controller.rb index 0d55fdfece..ac93da5128 100644 --- a/app/controllers/checklist_items_controller.rb +++ b/app/controllers/checklist_items_controller.rb @@ -13,7 +13,7 @@ def create set_checklist_updated_date(@hearing_type) redirect_to edit_hearing_type_path(@hearing_type), notice: "Checklist item was successfully created." else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -25,7 +25,7 @@ def update set_checklist_updated_date(@hearing_type) redirect_to edit_hearing_type_path(@hearing_type), notice: "Checklist item was successfully updated." else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end diff --git a/app/controllers/contact_topic_answers_controller.rb b/app/controllers/contact_topic_answers_controller.rb index 717a51ed7a..a741856133 100644 --- a/app/controllers/contact_topic_answers_controller.rb +++ b/app/controllers/contact_topic_answers_controller.rb @@ -8,7 +8,7 @@ def create if @contact_topic_answer.save render json: @contact_topic_answer.as_json, status: :created else - render json: @contact_topic_answer.errors.as_json, status: :unprocessable_entity + render json: @contact_topic_answer.errors.as_json, status: :unprocessable_content end end diff --git a/app/controllers/contact_topics_controller.rb b/app/controllers/contact_topics_controller.rb index 805cfd5103..72f9df6261 100644 --- a/app/controllers/contact_topics_controller.rb +++ b/app/controllers/contact_topics_controller.rb @@ -21,7 +21,7 @@ def create if @contact_topic.save redirect_to edit_casa_org_path(current_organization), notice: "Contact topic was successfully created." else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -32,7 +32,7 @@ def update if @contact_topic.update(contact_topic_params) redirect_to edit_casa_org_path(current_organization), notice: "Contact topic was successfully updated." else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end @@ -43,7 +43,7 @@ def soft_delete if @contact_topic.update(soft_delete: true) redirect_to edit_casa_org_path(current_organization), notice: "Contact topic was successfully removed." else - render :show, status: :unprocessable_entity + render :show, status: :unprocessable_content end end diff --git a/app/controllers/contact_type_groups_controller.rb b/app/controllers/contact_type_groups_controller.rb index dc2e606925..19cdcefa68 100644 --- a/app/controllers/contact_type_groups_controller.rb +++ b/app/controllers/contact_type_groups_controller.rb @@ -14,7 +14,7 @@ def create if @contact_type_group.save redirect_to edit_casa_org_path(current_organization), notice: "Contact Type Group was successfully created." else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -27,7 +27,7 @@ def update if @contact_type_group.update(contact_type_group_params) redirect_to edit_casa_org_path(current_organization), notice: "Contact Type Group was successfully updated." else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end diff --git a/app/controllers/contact_types_controller.rb b/app/controllers/contact_types_controller.rb index 5ca8a7966d..5a5cca5985 100644 --- a/app/controllers/contact_types_controller.rb +++ b/app/controllers/contact_types_controller.rb @@ -14,7 +14,7 @@ def create if @contact_type.save redirect_to edit_casa_org_path(current_organization), notice: "Contact Type was successfully created." else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -27,7 +27,7 @@ def update if @contact_type.update(contact_type_params) redirect_to edit_casa_org_path(current_organization), notice: "Contact Type was successfully updated." else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end diff --git a/app/controllers/court_dates_controller.rb b/app/controllers/court_dates_controller.rb index bb2c71e5e9..42b3cc5433 100644 --- a/app/controllers/court_dates_controller.rb +++ b/app/controllers/court_dates_controller.rb @@ -38,7 +38,7 @@ def create if @court_date.save && @casa_case.save redirect_to casa_case_court_date_path(@casa_case, @court_date), notice: "Court date was successfully created." else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -47,7 +47,7 @@ def update if @court_date.update(court_date_params(@casa_case)) redirect_to casa_case_court_date_path(@casa_case, @court_date), notice: "Court date was successfully updated." else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end diff --git a/app/controllers/custom_org_links_controller.rb b/app/controllers/custom_org_links_controller.rb index a49b22c8f3..d62794d98f 100644 --- a/app/controllers/custom_org_links_controller.rb +++ b/app/controllers/custom_org_links_controller.rb @@ -15,7 +15,7 @@ def create if @custom_org_link.save redirect_to edit_casa_org_path(current_organization), notice: "Custom link was successfully created." else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -28,7 +28,7 @@ def update if @custom_org_link.update(custom_org_link_params) redirect_to edit_casa_org_path(current_organization), notice: "Custom link was successfully updated." else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end diff --git a/app/controllers/fund_requests_controller.rb b/app/controllers/fund_requests_controller.rb index 99eca6a4d5..2d213449d1 100644 --- a/app/controllers/fund_requests_controller.rb +++ b/app/controllers/fund_requests_controller.rb @@ -15,7 +15,7 @@ def create FundRequestMailer.send_request(nil, @fund_request).deliver redirect_to casa_case_path(@casa_case), notice: "Fund Request was sent for case #{@casa_case.case_number}" else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end diff --git a/app/controllers/hearing_types_controller.rb b/app/controllers/hearing_types_controller.rb index 42c2592e7d..524ddf5ec5 100644 --- a/app/controllers/hearing_types_controller.rb +++ b/app/controllers/hearing_types_controller.rb @@ -14,7 +14,7 @@ def create if @hearing_type.save redirect_to edit_casa_org_path(current_organization), notice: "Hearing Type was successfully created." else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -27,7 +27,7 @@ def update if @hearing_type.update(hearing_type_params) redirect_to edit_casa_org_path(current_organization), notice: "Hearing Type was successfully updated." else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end diff --git a/app/controllers/judges_controller.rb b/app/controllers/judges_controller.rb index 0b3226e5c9..68dd5574df 100644 --- a/app/controllers/judges_controller.rb +++ b/app/controllers/judges_controller.rb @@ -14,7 +14,7 @@ def create if @judge.save redirect_to edit_casa_org_path(current_organization), notice: "Judge was successfully created." else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -27,7 +27,7 @@ def update if @judge.update(judge_params) redirect_to edit_casa_org_path(current_organization), notice: "Judge was successfully updated." else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end diff --git a/app/controllers/languages_controller.rb b/app/controllers/languages_controller.rb index a63e6a7fa2..bc6883fd22 100644 --- a/app/controllers/languages_controller.rb +++ b/app/controllers/languages_controller.rb @@ -18,7 +18,7 @@ def create if @language.save format.html { redirect_to edit_casa_org_path(current_organization.id), notice: "Language was successfully created." } else - format.html { render :new, status: :unprocessable_entity } + format.html { render :new, status: :unprocessable_content } end end end @@ -29,7 +29,7 @@ def update if @language.update(language_params) format.html { redirect_to edit_casa_org_path(current_organization.id), notice: "Language was successfully updated." } else - format.html { render :edit, status: :unprocessable_entity } + format.html { render :edit, status: :unprocessable_content } end end end diff --git a/app/controllers/learning_hour_topics_controller.rb b/app/controllers/learning_hour_topics_controller.rb index 7be8198c61..d95cd7ee06 100644 --- a/app/controllers/learning_hour_topics_controller.rb +++ b/app/controllers/learning_hour_topics_controller.rb @@ -18,7 +18,7 @@ def create if @learning_hour_topic.save redirect_to edit_casa_org_path(current_organization), notice: "Learning Topic was successfully created." else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -28,7 +28,7 @@ def update if @learning_hour_topic.update(learning_hour_topic_params) redirect_to edit_casa_org_path(current_organization), notice: "Learning Topic was successfully updated." else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end diff --git a/app/controllers/learning_hour_types_controller.rb b/app/controllers/learning_hour_types_controller.rb index 62b7cb35c5..94849d65dd 100644 --- a/app/controllers/learning_hour_types_controller.rb +++ b/app/controllers/learning_hour_types_controller.rb @@ -18,7 +18,7 @@ def create if @learning_hour_type.save redirect_to edit_casa_org_path(current_organization), notice: "Learning Type was successfully created." else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -28,7 +28,7 @@ def update if @learning_hour_type.update(learning_hour_type_params) redirect_to edit_casa_org_path(current_organization), notice: "Learning Type was successfully updated." else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end diff --git a/app/controllers/learning_hours_controller.rb b/app/controllers/learning_hours_controller.rb index f506fae93f..b26d177d50 100644 --- a/app/controllers/learning_hours_controller.rb +++ b/app/controllers/learning_hours_controller.rb @@ -24,7 +24,7 @@ def create if @learning_hour.save format.html { redirect_to learning_hours_path, notice: "New entry was successfully created." } else - format.html { render :new, status: :unprocessable_entity } + format.html { render :new, status: :unprocessable_content } end end end @@ -39,7 +39,7 @@ def update if @learning_hour.update(update_learning_hours_params) format.html { redirect_to learning_hour_path(@learning_hour), notice: "Entry was successfully updated." } else - format.html { render :edit, status: :unprocessable_entity } + format.html { render :edit, status: :unprocessable_content } end end end diff --git a/app/controllers/mileage_rates_controller.rb b/app/controllers/mileage_rates_controller.rb index ae8c1d376e..4d41b3d902 100644 --- a/app/controllers/mileage_rates_controller.rb +++ b/app/controllers/mileage_rates_controller.rb @@ -18,7 +18,7 @@ def create if @mileage_rate.save redirect_to mileage_rates_path else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -32,7 +32,7 @@ def update if @mileage_rate.update(mileage_rate_params) redirect_to mileage_rates_path else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end diff --git a/app/controllers/other_duties_controller.rb b/app/controllers/other_duties_controller.rb index 598f7bf0fd..7f3e1935f3 100644 --- a/app/controllers/other_duties_controller.rb +++ b/app/controllers/other_duties_controller.rb @@ -26,7 +26,7 @@ def create if @other_duty.save redirect_to other_duties_path, notice: "Duty was successfully created." else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -40,7 +40,7 @@ def update if @other_duty.update(other_duty_params) redirect_to other_duties_path, notice: "Duty was successfully updated." else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end diff --git a/app/controllers/placement_types_controller.rb b/app/controllers/placement_types_controller.rb index fd596483e2..23141d679b 100644 --- a/app/controllers/placement_types_controller.rb +++ b/app/controllers/placement_types_controller.rb @@ -15,7 +15,7 @@ def create if @placement_type.save redirect_to edit_casa_org_path(current_organization), notice: "Placement Type was successfully created." else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -29,7 +29,7 @@ def update if @placement_type.update(placement_type_params) redirect_to edit_casa_org_path(current_organization), notice: "Placement Type was successfully updated." else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end diff --git a/app/controllers/placements_controller.rb b/app/controllers/placements_controller.rb index 0bc7490e61..e3a15f46aa 100644 --- a/app/controllers/placements_controller.rb +++ b/app/controllers/placements_controller.rb @@ -27,7 +27,7 @@ def create if @placement.save redirect_to casa_case_placements_path(@casa_case), notice: "Placement was successfully created." else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -37,7 +37,7 @@ def update if @placement.update(placement_params) redirect_to casa_case_placements_path(@casa_case), notice: "Placement was successfully updated." else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end @@ -47,7 +47,7 @@ def destroy if @placement.destroy redirect_to casa_case_placements_path(@casa_case), notice: "Placement was successfully deleted." else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end diff --git a/app/controllers/supervisors_controller.rb b/app/controllers/supervisors_controller.rb index fb3452343d..c6415ae021 100644 --- a/app/controllers/supervisors_controller.rb +++ b/app/controllers/supervisors_controller.rb @@ -35,7 +35,7 @@ def create sms_status = deliver_sms_to @supervisor, body_msg redirect_to edit_supervisor_path(@supervisor), notice: sms_acct_creation_notice("supervisor", sms_status) else - render new_supervisor_path, status: :unprocessable_entity + render new_supervisor_path, status: :unprocessable_content end end @@ -55,7 +55,7 @@ def update @supervisor.filter_old_emails!(@supervisor.email) redirect_to edit_supervisor_path(@supervisor), notice: notice else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 144d4d3df7..d06e61fcad 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -16,19 +16,19 @@ def update flash[:success] = "Profile was successfully updated." redirect_to edit_users_path else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end def add_language if @language.nil? @user.errors.add(:language_id, "can not be blank. Please select a language before adding.") - return render "edit", status: :unprocessable_entity + return render "edit", status: :unprocessable_content end if current_user.languages.include?(@language) @user.errors.add(:language_id, "#{@language.name} is already in your languages list.") - return render "edit", status: :unprocessable_entity + return render "edit", status: :unprocessable_content end current_user.languages << @language @@ -54,11 +54,11 @@ def remove_language def update_password unless valid_user_password @user.errors.add(:base, "Current password is incorrect") - return render "edit", status: :unprocessable_entity + return render "edit", status: :unprocessable_content end unless update_user_password - return render "edit", status: :unprocessable_entity + return render "edit", status: :unprocessable_content end bypass_sign_in(@user) if @user == true_user @@ -72,11 +72,11 @@ def update_password def update_email unless valid_user_password @user.errors.add(:base, "Current password is incorrect") - return render "edit", status: :unprocessable_entity + return render "edit", status: :unprocessable_content end unless update_user_email - return render "edit", status: :unprocessable_entity + return render "edit", status: :unprocessable_content end bypass_sign_in(@user) if @user == true_user diff --git a/app/controllers/volunteers_controller.rb b/app/controllers/volunteers_controller.rb index 1cb691e115..0573c63b64 100644 --- a/app/controllers/volunteers_controller.rb +++ b/app/controllers/volunteers_controller.rb @@ -50,7 +50,7 @@ def create sms_status = deliver_sms_to @volunteer, account_activation_msg("volunteer", hash_of_short_urls) redirect_to edit_volunteer_path(@volunteer), notice: sms_acct_creation_notice("volunteer", sms_status) else - render :new, status: :unprocessable_entity + render :new, status: :unprocessable_content end end @@ -67,7 +67,7 @@ def update @volunteer.filter_old_emails!(@volunteer.email) redirect_to edit_volunteer_path(@volunteer), notice: notice else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end @@ -82,7 +82,7 @@ def activate redirect_to edit_volunteer_path(@volunteer), notice: "Volunteer was activated. They have been sent an email." end else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end @@ -91,7 +91,7 @@ def deactivate if @volunteer.deactivate redirect_to edit_volunteer_path(@volunteer), notice: "Volunteer was deactivated." else - render :edit, status: :unprocessable_entity + render :edit, status: :unprocessable_content end end diff --git a/spec/requests/additional_expenses_spec.rb b/spec/requests/additional_expenses_spec.rb index 43d1d3a1f1..419ad99562 100644 --- a/spec/requests/additional_expenses_spec.rb +++ b/spec/requests/additional_expenses_spec.rb @@ -38,7 +38,7 @@ it "fails and responds unprocessable_entity" do expect { subject }.not_to change(ContactTopicAnswer, :count) - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) end it "returns errors as json" do diff --git a/spec/requests/all_casa_admins/casa_admins_spec.rb b/spec/requests/all_casa_admins/casa_admins_spec.rb index 6ae6ea6067..4af32e4014 100644 --- a/spec/requests/all_casa_admins/casa_admins_spec.rb +++ b/spec/requests/all_casa_admins/casa_admins_spec.rb @@ -41,7 +41,7 @@ it "renders new page" do expect { subject }.not_to change(CasaAdmin, :count) - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(response).to render_template "casa_admins/new" end end @@ -94,7 +94,7 @@ it "renders new page" do subject - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(response).to render_template "casa_admins/edit" end end @@ -132,7 +132,7 @@ it "renders edit page" do subject - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(response).to render_template "casa_admins/edit" end end @@ -170,7 +170,7 @@ it "renders edit page" do subject - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(response).to render_template "casa_admins/edit" end end diff --git a/spec/requests/all_casa_admins/casa_orgs_spec.rb b/spec/requests/all_casa_admins/casa_orgs_spec.rb index 063797897c..74dfcdd45a 100644 --- a/spec/requests/all_casa_admins/casa_orgs_spec.rb +++ b/spec/requests/all_casa_admins/casa_orgs_spec.rb @@ -102,7 +102,7 @@ post all_casa_admins_casa_orgs_path(format: :json), params: params expect(response.content_type).to eq "application/json; charset=utf-8" - expect(response).to have_http_status :unprocessable_entity + expect(response).to have_http_status :unprocessable_content expect(response.body).to match "Name can't be blank" end end diff --git a/spec/requests/all_casa_admins/patch_notes_spec.rb b/spec/requests/all_casa_admins/patch_notes_spec.rb index 82ee6c5de3..e91ff01f61 100644 --- a/spec/requests/all_casa_admins/patch_notes_spec.rb +++ b/spec/requests/all_casa_admins/patch_notes_spec.rb @@ -73,7 +73,7 @@ post all_casa_admins_patch_notes_path, params: invalid_attributes expect(response.header["Content-Type"]).to match(/application\/json/) expect(response.body).not_to be_nil - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(JSON.parse(response.body)).to have_key("errors") end @@ -123,7 +123,7 @@ patch_note = PatchNote.create! valid_attributes patch all_casa_admins_patch_note_path(patch_note), params: invalid_attributes expect(response.body).not_to be_nil - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(JSON.parse(response.body)).to have_key("errors") end end diff --git a/spec/requests/all_casa_admins_spec.rb b/spec/requests/all_casa_admins_spec.rb index cba290073c..c3b741e30a 100644 --- a/spec/requests/all_casa_admins_spec.rb +++ b/spec/requests/all_casa_admins_spec.rb @@ -91,7 +91,7 @@ email: "" } } - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(response).to render_template "all_casa_admins/new" end @@ -102,7 +102,7 @@ } } - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(response.content_type).to eq("application/json; charset=utf-8") expect(response.body).to match("Email can't be blank".to_json) end @@ -132,7 +132,7 @@ it "does not update the all_casa_admin" do other_admin = create(:all_casa_admin) patch all_casa_admins_path, params: {all_casa_admin: {email: other_admin.email}} - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(admin.email).not_to eq "newemail@example.com" end @@ -142,7 +142,7 @@ patch all_casa_admins_path(format: :json), params: {all_casa_admin: {email: other_admin.email}} - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(response.content_type).to eq("application/json; charset=utf-8") expect(response.body).to match("Email has already been taken".to_json) end @@ -201,7 +201,7 @@ it "does not update the all_casa_admin password" do subject - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(admin.reload.valid_password?("newpassword")).to be false end @@ -216,7 +216,7 @@ it "also responds as json", :aggregate_failures do patch update_password_all_casa_admins_path(format: :json), params: params - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(response.content_type).to eq("application/json; charset=utf-8") expect(response.body).to match("Password confirmation doesn't match Password".to_json) end diff --git a/spec/requests/casa_admins_spec.rb b/spec/requests/casa_admins_spec.rb index 76718e8e66..348ded29eb 100644 --- a/spec/requests/casa_admins_spec.rb +++ b/spec/requests/casa_admins_spec.rb @@ -151,7 +151,7 @@ } expect(response.content_type).to eq("application/json; charset=utf-8") - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(response.body).to match("Email can't be blank".to_json) end end @@ -259,7 +259,7 @@ patch activate_casa_admin_path(casa_admin_inactive, format: :json) expect(response.content_type).to eq("application/json; charset=utf-8") - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(response.body).to match("Error message test".to_json) end end @@ -339,7 +339,7 @@ patch deactivate_casa_admin_path(casa_admin_active, format: :json) expect(response.content_type).to eq("application/json; charset=utf-8") - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(response.body).to match("Error message test".to_json) end end @@ -518,7 +518,7 @@ post casa_admins_path(format: :json), params: {casa_admin: params} expect(response.content_type).to eq("application/json; charset=utf-8") - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(response.body).to match("Some error message".to_json) end end diff --git a/spec/requests/casa_cases_spec.rb b/spec/requests/casa_cases_spec.rb index 858c2a3c33..7592113f8b 100644 --- a/spec/requests/casa_cases_spec.rb +++ b/spec/requests/casa_cases_spec.rb @@ -234,14 +234,14 @@ it "renders an unprocessable entity response (i.e. to display the 'new' template)" do post casa_cases_url, params: {casa_case: invalid_attributes} - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) end it "also respond to json", :aggregate_failures do post casa_cases_url(format: :json), params: {casa_case: invalid_attributes} expect(response.content_type).to eq("application/json; charset=utf-8") - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expected_response_body = [ "Birth month year youth can't be blank", "Case number can't be blank", @@ -272,7 +272,7 @@ it "renders an unprocessable entity response (i.e. to display the 'new' template)" do post casa_cases_url, params: {casa_case: invalid_params} - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) end end end @@ -330,14 +330,14 @@ context "with invalid parameters" do it "renders an unprocessable entity response displaying the edit template" do patch casa_case_url(casa_case), params: {casa_case: invalid_attributes} - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) end it "also responds as json", :aggregate_failures do patch casa_case_url(casa_case, format: :json), params: {casa_case: invalid_attributes} expect(response.content_type).to eq("application/json; charset=utf-8") - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(response.body).to match(["Case number can't be blank"].to_json) end end @@ -443,7 +443,7 @@ patch deactivate_casa_case_path(casa_case, format: :json), params: params expect(response.content_type).to eq("application/json; charset=utf-8") - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(response.body).to match([].to_json) end end @@ -502,7 +502,7 @@ patch reactivate_casa_case_path(casa_case, format: :json), params: params expect(response.content_type).to eq("application/json; charset=utf-8") - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(response.body).to match([].to_json) end end diff --git a/spec/requests/casa_org_spec.rb b/spec/requests/casa_org_spec.rb index 1edfa6e846..50500e19e7 100644 --- a/spec/requests/casa_org_spec.rb +++ b/spec/requests/casa_org_spec.rb @@ -113,7 +113,7 @@ end context "and html format" do - it { is_expected.to have_http_status(:unprocessable_entity) } + it { is_expected.to have_http_status(:unprocessable_content) } it "renders the edit template" do expect(request.body).to match(/error_explanation/) @@ -127,7 +127,7 @@ response end - it { is_expected.to have_http_status(:unprocessable_entity) } + it { is_expected.to have_http_status(:unprocessable_content) } it "returns correct payload" do response_data = request.body diff --git a/spec/requests/case_contacts/form_spec.rb b/spec/requests/case_contacts/form_spec.rb index 905e9cd464..841125a5eb 100644 --- a/spec/requests/case_contacts/form_spec.rb +++ b/spec/requests/case_contacts/form_spec.rb @@ -479,10 +479,10 @@ expect { request }.not_to change(case_contact.reload, :attributes) end - it "responds :unprocessable_entity and returns the errors" do + it "responds :unprocessable_content and returns the errors" do request - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) end end end diff --git a/spec/requests/case_court_reports_spec.rb b/spec/requests/case_court_reports_spec.rb index 5b5736848b..487819b8bf 100644 --- a/spec/requests/case_court_reports_spec.rb +++ b/spec/requests/case_court_reports_spec.rb @@ -274,7 +274,7 @@ expect_any_instance_of(CaseCourtReportsController).to receive(:save_report).and_raise StandardError.new("Unexpected Error") end - it { is_expected.to have_http_status(:unprocessable_entity) } + it { is_expected.to have_http_status(:unprocessable_content) } it "shows the correct error message" do expect(request.parsed_body["error_messages"]).to include("Unexpected Error") diff --git a/spec/requests/case_groups_spec.rb b/spec/requests/case_groups_spec.rb index f25e439526..6bb4e22b84 100644 --- a/spec/requests/case_groups_spec.rb +++ b/spec/requests/case_groups_spec.rb @@ -64,7 +64,7 @@ it "renders new template" do subject - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(response).to render_template(:new) end end @@ -104,7 +104,7 @@ it "renders new template" do subject - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(response).to render_template(:edit) end end diff --git a/spec/requests/contact_topic_answers_spec.rb b/spec/requests/contact_topic_answers_spec.rb index cf01be6113..934f6512f4 100644 --- a/spec/requests/contact_topic_answers_spec.rb +++ b/spec/requests/contact_topic_answers_spec.rb @@ -52,7 +52,7 @@ it "fails and responds unprocessable_entity" do expect { subject }.not_to change(ContactTopicAnswer, :count) - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) end it "returns errors as json" do diff --git a/spec/requests/contact_topics_spec.rb b/spec/requests/contact_topics_spec.rb index 5160c044f1..d1ce67dd56 100644 --- a/spec/requests/contact_topics_spec.rb +++ b/spec/requests/contact_topics_spec.rb @@ -83,7 +83,7 @@ it "renders a response with 422 status (i.e. to display the 'new' template)" do post contact_topics_url, params: {contact_topic: attributes} - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) end end end @@ -133,7 +133,7 @@ it "renders a response with 422 status (i.e. to display the 'edit' template)" do patch contact_topic_url(contact_topic), params: {contact_topic: attributes} - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) end end end diff --git a/spec/requests/court_dates_spec.rb b/spec/requests/court_dates_spec.rb index eaa9191566..38847e29bf 100644 --- a/spec/requests/court_dates_spec.rb +++ b/spec/requests/court_dates_spec.rb @@ -270,7 +270,7 @@ it "renders an unprocessable entity response (i.e. to display the 'new' template)" do post casa_case_court_dates_path(casa_case), params: {court_date: invalid_attributes} - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expected_errors = [ "Date can't be blank" ].freeze @@ -314,7 +314,7 @@ it "renders an unprocessable entity response displaying the edit template" do patch casa_case_court_date_path(casa_case, court_date), params: {court_date: invalid_attributes} - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expected_errors = [ "Date can't be blank" ].freeze diff --git a/spec/requests/fund_requests_spec.rb b/spec/requests/fund_requests_spec.rb index 4c0293c384..c3c3529a39 100644 --- a/spec/requests/fund_requests_spec.rb +++ b/spec/requests/fund_requests_spec.rb @@ -169,7 +169,7 @@ post casa_case_fund_request_path(casa_case), params: params }.not_to change(FundRequest, :count) - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) end end end diff --git a/spec/requests/mileage_rates_spec.rb b/spec/requests/mileage_rates_spec.rb index ee9988a691..77071e4715 100644 --- a/spec/requests/mileage_rates_spec.rb +++ b/spec/requests/mileage_rates_spec.rb @@ -82,7 +82,7 @@ expect { post mileage_rates_path, params: params }.not_to change { MileageRate.count } - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) end end @@ -106,7 +106,7 @@ expect { post mileage_rates_path, params: params }.not_to change { MileageRate.count } - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) end end end @@ -142,7 +142,7 @@ it "does not update a mileage rate" do patch mileage_rate_path(mileage_rate), params: params - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) mileage_rate.reload expect(mileage_rate.amount).to eq(10.11) diff --git a/spec/requests/other_duties_spec.rb b/spec/requests/other_duties_spec.rb index e6015c2476..db53089db5 100644 --- a/spec/requests/other_duties_spec.rb +++ b/spec/requests/other_duties_spec.rb @@ -60,7 +60,7 @@ expect { post other_duties_path, params: {other_duty: attributes_for(:other_duty, notes: "")} }.not_to change(OtherDuty, :count) - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) end end end @@ -170,7 +170,7 @@ patch other_duty_path(other_duty), params: {other_duty: {notes: ""}} expect(other_duty.reload.notes).to eq "Test 1" - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) end end end diff --git a/spec/requests/supervisors_spec.rb b/spec/requests/supervisors_spec.rb index fd282e760a..749fdd3046 100644 --- a/spec/requests/supervisors_spec.rb +++ b/spec/requests/supervisors_spec.rb @@ -177,7 +177,7 @@ it "gracefully fails" do patch supervisor_path(supervisor), params: {supervisor: {email: other_supervisor.email}} - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) end end end diff --git a/spec/requests/users_spec.rb b/spec/requests/users_spec.rb index 0e7ef5a609..2f43ae1a97 100644 --- a/spec/requests/users_spec.rb +++ b/spec/requests/users_spec.rb @@ -429,7 +429,7 @@ patch add_language_users_path(volunteer), params: { language_id: "" } - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(response.body).to include("Please select a language before adding.") end end @@ -453,7 +453,7 @@ end it "notifies the user that the language is already in their list" do - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(response.body).to include("#{language.name} is already in your languages list.") end end diff --git a/spec/requests/volunteers_spec.rb b/spec/requests/volunteers_spec.rb index a1586e7eb8..a5578d979a 100644 --- a/spec/requests/volunteers_spec.rb +++ b/spec/requests/volunteers_spec.rb @@ -219,7 +219,7 @@ post volunteers_url, params: params }.to change(Volunteer, :count).by(0) .and change(ActionMailer::Base.deliveries, :count).by(0) - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) end end end @@ -263,7 +263,7 @@ patch volunteer_path(volunteer), params: { volunteer: {email: other_volunteer.email, display_name: "New Name", phone_number: "+15463457898"} } - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) volunteer.reload expect(volunteer.display_name).not_to eq "New Name"