Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Replace deprecated :unprocessable_entity with :unprocessable_content (#13585)
Damian Legawiec5e33d00504a3
diff --git a/backend/engines/admin/app/controllers/spree/admin/action_text/video_embeds_controller.rb b/backend/engines/admin/app/controllers/spree/admin/action_text/video_embeds_controller.rbindex 3187d4bae8..b240b4f3ac 100644--- a/backend/engines/admin/app/controllers/spree/admin/action_text/video_embeds_controller.rb+++ b/backend/engines/admin/app/controllers/spree/admin/action_text/video_embeds_controller.rb@@ -20,7 +20,7 @@ module Spreerender json: { sgid: video_embed.attachable_sgid, content: content }, status: :createdelse- render json: { error: video_embed.errors.full_messages.to_sentence }, status: :unprocessable_entity+ render json: { error: video_embed.errors.full_messages.to_sentence }, status: :unprocessable_contentendenddiff --git a/backend/engines/admin/app/controllers/spree/admin/admin_users_controller.rb b/backend/engines/admin/app/controllers/spree/admin/admin_users_controller.rbindex cf188a6e2f..d4cff8b04c 100644--- a/backend/engines/admin/app/controllers/spree/admin/admin_users_controller.rb+++ b/backend/engines/admin/app/controllers/spree/admin/admin_users_controller.rb@@ -56,7 +56,7 @@ module Spreeendredirect_to spree.admin_pathelse- render :new, status: :unprocessable_entity+ render :new, status: :unprocessable_contentendend@@ -74,7 +74,7 @@ module Spreeif @admin_user.update(permitted_params)redirect_to spree.admin_admin_user_path(@admin_user), status: :see_other, notice: flash_message_for(@admin_user, :successfully_updated)else- render :edit, status: :unprocessable_entity+ render :edit, status: :unprocessable_contentendenddiff --git a/backend/engines/admin/app/controllers/spree/admin/assets_controller.rb b/backend/engines/admin/app/controllers/spree/admin/assets_controller.rbindex c1173ea84e..73dd5ff024 100644--- a/backend/engines/admin/app/controllers/spree/admin/assets_controller.rb+++ b/backend/engines/admin/app/controllers/spree/admin/assets_controller.rb@@ -14,7 +14,7 @@ module Spreestore_uploaded_asset_in_session(@asset, @asset.viewable_type) if @asset.viewable.nil? || @asset.viewable.new_record?elseflash.now[:error] = @asset.errors.full_messages.to_sentence- render :create, status: :unprocessable_entity+ render :create, status: :unprocessable_contentendend@@ -27,7 +27,7 @@ module Spreeformat.json { render json: @asset }endelse- head :unprocessable_entity+ head :unprocessable_contentendenddiff --git a/backend/engines/admin/app/controllers/spree/admin/integrations_controller.rb b/backend/engines/admin/app/controllers/spree/admin/integrations_controller.rbindex 181792a48c..c06480de97 100644--- a/backend/engines/admin/app/controllers/spree/admin/integrations_controller.rb+++ b/backend/engines/admin/app/controllers/spree/admin/integrations_controller.rb@@ -49,7 +49,7 @@ module Spreeunless @integration.can_connect?@integration.errors.add(:base, :unable_to_connect, error_message: @integration.connection_error_message)- render action == :create ? :new : :edit, status: :unprocessable_entity+ render action == :create ? :new : :edit, status: :unprocessable_contentendenddiff --git a/backend/engines/admin/app/controllers/spree/admin/invitations_controller.rb b/backend/engines/admin/app/controllers/spree/admin/invitations_controller.rbindex c6b3c8330b..6c3195047c 100644--- a/backend/engines/admin/app/controllers/spree/admin/invitations_controller.rb+++ b/backend/engines/admin/app/controllers/spree/admin/invitations_controller.rb@@ -42,7 +42,7 @@ module Spreeformat.turbo_streamendelse- render :new, status: :unprocessable_entity+ render :new, status: :unprocessable_contentendenddiff --git a/backend/engines/admin/app/controllers/spree/admin/orders/adjustments_controller.rb b/backend/engines/admin/app/controllers/spree/admin/orders/adjustments_controller.rbindex 525ea8cb90..60c5c20342 100644--- a/backend/engines/admin/app/controllers/spree/admin/orders/adjustments_controller.rb+++ b/backend/engines/admin/app/controllers/spree/admin/orders/adjustments_controller.rb@@ -35,7 +35,7 @@ module Spreeflash.now[:error] = @adjustment.errors.full_messages.to_sentencerespond_to do |format|format.turbo_stream- format.html { render :new, status: :unprocessable_entity }+ format.html { render :new, status: :unprocessable_content }endendend@@ -58,7 +58,7 @@ module Spreeendelseflash.now[:error] = @adjustment.errors.full_messages.to_sentence- render :edit, status: :unprocessable_entity+ render :edit, status: :unprocessable_contentendenddiff --git a/backend/engines/admin/app/controllers/spree/admin/orders/billing_address_controller.rb b/backend/engines/admin/app/controllers/spree/admin/orders/billing_address_controller.rbindex 7b208bfec8..f647ec8768 100644--- a/backend/engines/admin/app/controllers/spree/admin/orders/billing_address_controller.rb+++ b/backend/engines/admin/app/controllers/spree/admin/orders/billing_address_controller.rb@@ -48,7 +48,7 @@ module Spreeflash[:success] = Spree.t(:successfully_created, resource: Spree.t(:billing_address))redirect_to spree.edit_admin_order_path(@order)else- render :create, status: :unprocessable_entity+ render :create, status: :unprocessable_contentendend@@ -88,7 +88,7 @@ module Spreeflash[:success] = Spree.t(:successfully_updated, resource: Spree.t(:billing_address))redirect_to spree.edit_admin_order_path(@order)else- render :update, status: :unprocessable_entity+ render :update, status: :unprocessable_contentendenddiff --git a/backend/engines/admin/app/controllers/spree/admin/orders/shipping_address_controller.rb b/backend/engines/admin/app/controllers/spree/admin/orders/shipping_address_controller.rbindex bd82dbf178..2be991c6c6 100644--- a/backend/engines/admin/app/controllers/spree/admin/orders/shipping_address_controller.rb+++ b/backend/engines/admin/app/controllers/spree/admin/orders/shipping_address_controller.rb@@ -36,7 +36,7 @@ module Spreeredirect_to spree.edit_admin_order_path(@order)else- render :create, status: :unprocessable_entity+ render :create, status: :unprocessable_contentendend@@ -70,7 +70,7 @@ module Spreeredirect_to spree.edit_admin_order_path(@order)else- render :update, status: :unprocessable_entity+ render :update, status: :unprocessable_contentendenddiff --git a/backend/engines/admin/app/controllers/spree/admin/orders/user_controller.rb b/backend/engines/admin/app/controllers/spree/admin/orders/user_controller.rbindex 3eee9b2928..39060479cb 100644--- a/backend/engines/admin/app/controllers/spree/admin/orders/user_controller.rb+++ b/backend/engines/admin/app/controllers/spree/admin/orders/user_controller.rb@@ -29,11 +29,11 @@ module Spreeredirect_to spree.edit_admin_order_path(@order)elseflash[:error] = result.error.value.full_messages.to_sentence- redirect_to spree.new_admin_order_user_path(@order), status: :unprocessable_entity+ redirect_to spree.new_admin_order_user_path(@order), status: :unprocessable_contentendelseflash[:error] = @user.errors.full_messages.to_sentence- redirect_to spree.new_admin_order_user_path(@order), status: :unprocessable_entity+ redirect_to spree.new_admin_order_user_path(@order), status: :unprocessable_contentendelse@user = @order.build_user(user_params)@@ -47,7 +47,7 @@ module Spreeredirect_to spree.edit_admin_order_path(@order)elseflash[:error] = @user.errors.full_messages.to_sentence- redirect_to spree.new_admin_order_user_path(@order), status: :unprocessable_entity+ redirect_to spree.new_admin_order_user_path(@order), status: :unprocessable_contentendendenddiff --git a/backend/engines/admin/app/controllers/spree/admin/orders_controller.rb b/backend/engines/admin/app/controllers/spree/admin/orders_controller.rbindex 38402579e3..315c04b735 100644--- a/backend/engines/admin/app/controllers/spree/admin/orders_controller.rb+++ b/backend/engines/admin/app/controllers/spree/admin/orders_controller.rb@@ -24,7 +24,7 @@ module Spreeflash[:success] = flash_message_for(@order, :successfully_created)redirect_to spree.edit_admin_order_path(@order)else- render :new, status: :unprocessable_entity+ render :new, status: :unprocessable_contentendenddiff --git a/backend/engines/admin/app/controllers/spree/admin/payments_controller.rb b/backend/engines/admin/app/controllers/spree/admin/payments_controller.rbindex 5bf4f5a72d..88a8980543 100644--- a/backend/engines/admin/app/controllers/spree/admin/payments_controller.rb+++ b/backend/engines/admin/app/controllers/spree/admin/payments_controller.rb@@ -48,13 +48,13 @@ module Spreeinvoke_callbacks(:create, :fails)flash[:error] = e.message.to_s- render :new, status: :unprocessable_entity+ render :new, status: :unprocessable_contentrescue ActiveRecord::RecordInvalid => _e@object.failure if defined?(@object) && @object.persisted?invoke_callbacks(:create, :fails)flash[:error] = @object.errors.full_messages.to_sentence- render :new, status: :unprocessable_entity+ render :new, status: :unprocessable_contentenddef capturediff --git a/backend/engines/admin/app/controllers/spree/admin/products_controller.rb b/backend/engines/admin/app/controllers/spree/admin/products_controller.rbindex 543f8df803..204c9eb518 100644--- a/backend/engines/admin/app/controllers/spree/admin/products_controller.rb+++ b/backend/engines/admin/app/controllers/spree/admin/products_controller.rb@@ -69,7 +69,7 @@ module Spree# update the product again@product.slug = @product.slug_was if @product.slug.blank?invoke_callbacks(:update, :fails)- render :edit, status: :unprocessable_entity+ render :edit, status: :unprocessable_contentendenddiff --git a/backend/engines/admin/app/controllers/spree/admin/profile_controller.rb b/backend/engines/admin/app/controllers/spree/admin/profile_controller.rbindex 507f8a1ec6..b7b102202c 100644--- a/backend/engines/admin/app/controllers/spree/admin/profile_controller.rb+++ b/backend/engines/admin/app/controllers/spree/admin/profile_controller.rb@@ -19,7 +19,7 @@ module Spreeflash[:success] = flash_message_for(@user, :successfully_updated)redirect_to spree.edit_admin_profile_pathelse- render :edit, status: :unprocessable_entity+ render :edit, status: :unprocessable_contentendenddiff --git a/backend/engines/admin/app/controllers/spree/admin/resource_controller.rb b/backend/engines/admin/app/controllers/spree/admin/resource_controller.rbindex 8693af5a7b..8d5b7d13b2 100644--- a/backend/engines/admin/app/controllers/spree/admin/resource_controller.rb+++ b/backend/engines/admin/app/controllers/spree/admin/resource_controller.rb@@ -51,7 +51,7 @@ class Spree::Admin::ResourceController < Spree::Admin::BaseControllerflash.now[:error] = @object.errors.full_messages.join(', ')endend- format.html { render action: :edit, status: :unprocessable_entity }+ format.html { render action: :edit, status: :unprocessable_content }endendend@@ -82,7 +82,7 @@ class Spree::Admin::ResourceController < Spree::Admin::BaseControllerflash.now[:error] = @object.errors.full_messages.join(', ')endend- format.html { render action: :new, status: :unprocessable_entity }+ format.html { render action: :new, status: :unprocessable_content }endendenddiff --git a/backend/engines/admin/app/controllers/spree/admin/store_credits_controller.rb b/backend/engines/admin/app/controllers/spree/admin/store_credits_controller.rbindex 7f0aaaa596..6f5764e981 100644--- a/backend/engines/admin/app/controllers/spree/admin/store_credits_controller.rb+++ b/backend/engines/admin/app/controllers/spree/admin/store_credits_controller.rb@@ -26,7 +26,7 @@ module Spreeredirect_to spree.admin_user_path(parent)elseflash[:error] = Spree.t('store_credit.errors.unable_to_create')- render :new, status: :unprocessable_entity+ render :new, status: :unprocessable_contentendend@@ -38,7 +38,7 @@ module Spreeredirect_to spree.admin_user_store_credit_path(parent, @store_credit)elseflash[:error] = Spree.t('store_credit.errors.unable_to_update')- render :edit, status: :unprocessable_entity+ render :edit, status: :unprocessable_contentendenddiff --git a/backend/engines/admin/app/controllers/spree/admin/stores_controller.rb b/backend/engines/admin/app/controllers/spree/admin/stores_controller.rbindex bc2902216f..6d2994829c 100644--- a/backend/engines/admin/app/controllers/spree/admin/stores_controller.rb+++ b/backend/engines/admin/app/controllers/spree/admin/stores_controller.rb@@ -30,7 +30,7 @@ module Spreeflash[:success] = flash_message_for(@store, :successfully_created)redirect_to spree.admin_getting_started_url(host: @store.url), allow_other_host: trueelse- render :new, status: :unprocessable_entity+ render :new, status: :unprocessable_contentendenddiff --git a/backend/engines/admin/app/controllers/spree/admin/taxons_controller.rb b/backend/engines/admin/app/controllers/spree/admin/taxons_controller.rbindex a3b521ce52..62f787f4c4 100644--- a/backend/engines/admin/app/controllers/spree/admin/taxons_controller.rb+++ b/backend/engines/admin/app/controllers/spree/admin/taxons_controller.rb@@ -38,7 +38,7 @@ module Spreeif @taxon.move_to_child_with_index(new_parent, new_index)head :okelse- head :unprocessable_entity+ head :unprocessable_contentendenddiff --git a/backend/engines/admin/app/controllers/spree/admin/users_controller.rb b/backend/engines/admin/app/controllers/spree/admin/users_controller.rbindex af4869b27a..3da7c17a39 100644--- a/backend/engines/admin/app/controllers/spree/admin/users_controller.rb+++ b/backend/engines/admin/app/controllers/spree/admin/users_controller.rb@@ -58,7 +58,7 @@ module Spreeflash[:success] = flash_message_for(@user, :successfully_created)redirect_to spree.admin_user_path(@user)else- render :new, status: :unprocessable_entity+ render :new, status: :unprocessable_contentendenddiff --git a/backend/engines/admin/spec/controllers/spree/admin/admin_users_controller_spec.rb b/backend/engines/admin/spec/controllers/spree/admin/admin_users_controller_spec.rbindex fa5a792f81..5150c4b763 100644--- a/backend/engines/admin/spec/controllers/spree/admin/admin_users_controller_spec.rb+++ b/backend/engines/admin/spec/controllers/spree/admin/admin_users_controller_spec.rb@@ -204,7 +204,7 @@ RSpec.describe Spree::Admin::AdminUsersController, type: :controller doit 'returns unprocessable entity status' dopost :create, params: invalid_params- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)endendend@@ -283,7 +283,7 @@ RSpec.describe Spree::Admin::AdminUsersController, type: :controller doendit 'returns unprocessable entity status' do- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)endendenddiff --git a/backend/engines/admin/spec/controllers/spree/admin/custom_domains_controller_spec.rb b/backend/engines/admin/spec/controllers/spree/admin/custom_domains_controller_spec.rbindex 4fe5b30789..5cba56d8d4 100644--- a/backend/engines/admin/spec/controllers/spree/admin/custom_domains_controller_spec.rb+++ b/backend/engines/admin/spec/controllers/spree/admin/custom_domains_controller_spec.rb@@ -73,7 +73,7 @@ describe Spree::Admin::CustomDomainsController, type: :controller doit 'does not create a custom domain' doexpect { subject }.not_to change(Spree::CustomDomain, :count)- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)expect(response).to render_template(:new)endend@@ -126,7 +126,7 @@ describe Spree::Admin::CustomDomainsController, type: :controller doit 'does not update the custom domain' doexpect { subject }.not_to change { custom_domain.reload.url }- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)expect(response).to render_template(:edit)endenddiff --git a/backend/engines/admin/spec/controllers/spree/admin/gift_card_batches_controller_spec.rb b/backend/engines/admin/spec/controllers/spree/admin/gift_card_batches_controller_spec.rbindex f38f1904b4..aadaf27268 100644--- a/backend/engines/admin/spec/controllers/spree/admin/gift_card_batches_controller_spec.rb+++ b/backend/engines/admin/spec/controllers/spree/admin/gift_card_batches_controller_spec.rb@@ -81,7 +81,7 @@ describe Spree::Admin::GiftCardBatchesController, type: :controller doit 'renders the new template' dosubjectexpect(response).to render_template(:new)- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)endendenddiff --git a/backend/engines/admin/spec/controllers/spree/admin/gift_cards_controller_spec.rb b/backend/engines/admin/spec/controllers/spree/admin/gift_cards_controller_spec.rbindex f56a972ec3..f5e4a8c697 100644--- a/backend/engines/admin/spec/controllers/spree/admin/gift_cards_controller_spec.rb+++ b/backend/engines/admin/spec/controllers/spree/admin/gift_cards_controller_spec.rb@@ -205,7 +205,7 @@ describe Spree::Admin::GiftCardsController, type: :controller doit 'renders the new template' dosubjectexpect(response).to render_template(:new)- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)endendend@@ -280,7 +280,7 @@ describe Spree::Admin::GiftCardsController, type: :controller doit 'renders the edit template' dosubjectexpect(response).to render_template(:edit)- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)endendenddiff --git a/backend/engines/admin/spec/controllers/spree/admin/imports_controller_spec.rb b/backend/engines/admin/spec/controllers/spree/admin/imports_controller_spec.rbindex f71f97bc30..3ef5664992 100644--- a/backend/engines/admin/spec/controllers/spree/admin/imports_controller_spec.rb+++ b/backend/engines/admin/spec/controllers/spree/admin/imports_controller_spec.rb@@ -72,7 +72,7 @@ RSpec.describe Spree::Admin::ImportsController, type: :controller dopost :create, params: { import: import_params }}.not_to change(Spree::Import, :count)- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)endendenddiff --git a/backend/engines/admin/spec/controllers/spree/admin/invitations_controller_spec.rb b/backend/engines/admin/spec/controllers/spree/admin/invitations_controller_spec.rbindex 397e884469..a60fa511d0 100644--- a/backend/engines/admin/spec/controllers/spree/admin/invitations_controller_spec.rb+++ b/backend/engines/admin/spec/controllers/spree/admin/invitations_controller_spec.rb@@ -120,7 +120,7 @@ RSpec.describe Spree::Admin::InvitationsController, type: :controller doit 'returns unprocessable entity status' dopost :create, params: invalid_params- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)endendenddiff --git a/backend/engines/admin/spec/controllers/spree/admin/metafield_definitions_controller_spec.rb b/backend/engines/admin/spec/controllers/spree/admin/metafield_definitions_controller_spec.rbindex 73df1e710d..cfb46db8c1 100644--- a/backend/engines/admin/spec/controllers/spree/admin/metafield_definitions_controller_spec.rb+++ b/backend/engines/admin/spec/controllers/spree/admin/metafield_definitions_controller_spec.rb@@ -97,7 +97,7 @@ RSpec.describe Spree::Admin::MetafieldDefinitionsController, type: :controller dit 'does not update and re-renders edit' doput :update, params: { id: metafield_definition.to_param, metafield_definition: { name: '' } }expect(response).to render_template(:edit)- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)expect(assigns(:object).reload.name).not_to eq('')endenddiff --git a/backend/engines/admin/spec/controllers/spree/admin/products_controller_spec.rb b/backend/engines/admin/spec/controllers/spree/admin/products_controller_spec.rbindex 872d4a4ec6..42b2309a42 100644--- a/backend/engines/admin/spec/controllers/spree/admin/products_controller_spec.rb+++ b/backend/engines/admin/spec/controllers/spree/admin/products_controller_spec.rb@@ -1206,7 +1206,7 @@ RSpec.describe Spree::Admin::ProductsController, type: :controller doit 'renders the edit page' doexpect(response).to render_template(:edit)- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)endit 'renders the error' dodiff --git a/backend/engines/api/app/controllers/concerns/spree/api/v3/error_handler.rb b/backend/engines/api/app/controllers/concerns/spree/api/v3/error_handler.rbindex 5eb8a0c134..bb565736c9 100644--- a/backend/engines/api/app/controllers/concerns/spree/api/v3/error_handler.rb+++ b/backend/engines/api/app/controllers/concerns/spree/api/v3/error_handler.rb@@ -87,13 +87,13 @@ module Spreerender_error(code: code,message: message,- status: :unprocessable_entity,+ status: :unprocessable_content,details: details)end# Convenience method for service result errors- def render_service_error(error, code: ERROR_CODES[:processing_error], status: :unprocessable_entity)+ def render_service_error(error, code: ERROR_CODES[:processing_error], status: :unprocessable_content)if error.is_a?(ActiveModel::Errors)render_validation_error(error, code: code)elsif error.is_a?(String)@@ -104,7 +104,7 @@ module Spreeend# Legacy support - redirect to new error handling- def render_errors(errors, status = :unprocessable_entity)+ def render_errors(errors, status = :unprocessable_content)code = infer_error_code(errors, status)if errors.is_a?(ActiveModel::Errors)@@ -140,7 +140,7 @@ module Spreerender_error(code: ERROR_CODES[:gateway_error],message: exception.message,- status: :unprocessable_entity+ status: :unprocessable_content)end@@ -182,7 +182,7 @@ module Spreerender_error(code: ERROR_CODES[:order_cannot_transition],message: exception.message,- status: :unprocessable_entity+ status: :unprocessable_content)end@@ -204,7 +204,7 @@ module SpreeERROR_CODES[:access_denied]when :bad_requestERROR_CODES[:invalid_request]- when :unprocessable_entity+ when :unprocessable_contenterrors.is_a?(ActiveModel::Errors) ? ERROR_CODES[:validation_error] : ERROR_CODES[:processing_error]elseERROR_CODES[:processing_error]diff --git a/backend/engines/api/app/controllers/spree/api/v3/store/cart_controller.rb b/backend/engines/api/app/controllers/spree/api/v3/store/cart_controller.rbindex 4daa7cc394..d0981fcb09 100644--- a/backend/engines/api/app/controllers/spree/api/v3/store/cart_controller.rb+++ b/backend/engines/api/app/controllers/spree/api/v3/store/cart_controller.rb@@ -45,7 +45,7 @@ module Spreerender_error(code: ERROR_CODES[:order_already_completed],message: 'Cannot associate a completed order',- status: :unprocessable_entity+ status: :unprocessable_content)returnenddiff --git a/backend/engines/api/lib/spree/api/testing_support/v3/base.rb b/backend/engines/api/lib/spree/api/testing_support/v3/base.rbindex 3a50ec035c..9328591c02 100644--- a/backend/engines/api/lib/spree/api/testing_support/v3/base.rb+++ b/backend/engines/api/lib/spree/api/testing_support/v3/base.rb@@ -90,7 +90,7 @@ endshared_examples 'returns 422 Unprocessable Entity' doit 'returns 422 status' dosubject- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)endenddiff --git a/backend/engines/api/spec/controllers/spree/api/v3/store/auth_controller_spec.rb b/backend/engines/api/spec/controllers/spree/api/v3/store/auth_controller_spec.rbindex 0b1eb71326..3889b459a4 100644--- a/backend/engines/api/spec/controllers/spree/api/v3/store/auth_controller_spec.rb+++ b/backend/engines/api/spec/controllers/spree/api/v3/store/auth_controller_spec.rb@@ -99,7 +99,7 @@ RSpec.describe Spree::Api::V3::Store::AuthController, type: :controller doit 'returns validation error for blank email' dopost :register, params: { email: '', password: 'password123', password_confirmation: 'password123' }- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)expect(json_response['error']['code']).to eq('validation_error')expect(json_response['error']['details']['email']).to be_presentend@@ -108,7 +108,7 @@ RSpec.describe Spree::Api::V3::Store::AuthController, type: :controller doexisting_user = create(:user)post :register, params: { email: existing_user.email, password: 'password123', password_confirmation: 'password123' }- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)expect(json_response['error']['code']).to eq('validation_error')expect(json_response['error']['details']['email']).to be_presentenddiff --git a/backend/engines/api/spec/controllers/spree/api/v3/store/cart_controller_spec.rb b/backend/engines/api/spec/controllers/spree/api/v3/store/cart_controller_spec.rbindex 5ea792dd31..b54c2d7279 100644--- a/backend/engines/api/spec/controllers/spree/api/v3/store/cart_controller_spec.rb+++ b/backend/engines/api/spec/controllers/spree/api/v3/store/cart_controller_spec.rb@@ -240,7 +240,7 @@ RSpec.describe Spree::Api::V3::Store::CartController, type: :controller dopatch :associate, params: { order_token: completed_order.token }- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)expect(json_response['error']['code']).to eq('order_already_completed')enddiff --git a/backend/engines/api/spec/controllers/spree/api/v3/store/customer/account_controller_spec.rb b/backend/engines/api/spec/controllers/spree/api/v3/store/customer/account_controller_spec.rbindex ce225c9a3c..495d379844 100644--- a/backend/engines/api/spec/controllers/spree/api/v3/store/customer/account_controller_spec.rb+++ b/backend/engines/api/spec/controllers/spree/api/v3/store/customer/account_controller_spec.rb@@ -88,7 +88,7 @@ RSpec.describe Spree::Api::V3::Store::Customer::AccountController, type: :controit 'returns errors for blank email' dopatch :update, params: { email: '' }- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)expect(json_response['error']['code']).to eq('validation_error')expect(json_response['error']['details']['email']).to be_presentend@@ -97,7 +97,7 @@ RSpec.describe Spree::Api::V3::Store::Customer::AccountController, type: :controother_user = create(:user)patch :update, params: { email: other_user.email }- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)expect(json_response['error']['code']).to eq('validation_error')expect(json_response['error']['details']['email']).to be_presentenddiff --git a/backend/engines/api/spec/controllers/spree/api/v3/store/customer/addresses_controller_spec.rb b/backend/engines/api/spec/controllers/spree/api/v3/store/customer/addresses_controller_spec.rbindex b88f93d274..999c5881f4 100644--- a/backend/engines/api/spec/controllers/spree/api/v3/store/customer/addresses_controller_spec.rb+++ b/backend/engines/api/spec/controllers/spree/api/v3/store/customer/addresses_controller_spec.rb@@ -121,7 +121,7 @@ RSpec.describe Spree::Api::V3::Store::Customer::AddressesController, type: :contit 'returns validation errors for missing firstname' dopost :create, params: address_params.except(:firstname)- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)expect(json_response['error']['code']).to eq('validation_error')endenddiff --git a/backend/engines/api/spec/controllers/spree/api/v3/store/orders/coupon_codes_controller_spec.rb b/backend/engines/api/spec/controllers/spree/api/v3/store/orders/coupon_codes_controller_spec.rbindex 45b14b660a..cf6b7d0e95 100644--- a/backend/engines/api/spec/controllers/spree/api/v3/store/orders/coupon_codes_controller_spec.rb+++ b/backend/engines/api/spec/controllers/spree/api/v3/store/orders/coupon_codes_controller_spec.rb@@ -33,7 +33,7 @@ RSpec.describe Spree::Api::V3::Store::Orders::CouponCodesController, type: :contit 'returns error for invalid coupon code' dopost :create, params: { order_id: order.to_param, code: 'INVALID' }- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)expect(json_response['error']).to be_presentend@@ -43,7 +43,7 @@ RSpec.describe Spree::Api::V3::Store::Orders::CouponCodesController, type: :contpost :create, params: { order_id: order.to_param, code: 'SAVE10' }- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)endend@@ -82,7 +82,7 @@ RSpec.describe Spree::Api::V3::Store::Orders::CouponCodesController, type: :contpost :create, params: { order_id: order.to_param, code: 'giftcard123' }- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)endit 'returns error for redeemed gift card' do@@ -90,7 +90,7 @@ RSpec.describe Spree::Api::V3::Store::Orders::CouponCodesController, type: :contpost :create, params: { order_id: order.to_param, code: 'giftcard123' }- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)endend@@ -103,7 +103,7 @@ RSpec.describe Spree::Api::V3::Store::Orders::CouponCodesController, type: :contit 'returns error' dopost :create, params: { order_id: order.to_param, code: 'EXPIRED' }- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)endenddiff --git a/backend/engines/api/spec/controllers/spree/api/v3/store/orders/store_credits_controller_spec.rb b/backend/engines/api/spec/controllers/spree/api/v3/store/orders/store_credits_controller_spec.rbindex aec1ef4a5d..cc11dd57b0 100644--- a/backend/engines/api/spec/controllers/spree/api/v3/store/orders/store_credits_controller_spec.rb+++ b/backend/engines/api/spec/controllers/spree/api/v3/store/orders/store_credits_controller_spec.rb@@ -37,7 +37,7 @@ RSpec.describe Spree::Api::V3::Store::Orders::StoreCreditsController, type: :conrequest.headers['Authorization'] = "Bearer #{jwt}"post :create, params: { order_id: order_without_credit.to_param, amount: 10 }- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)expect(json_response['error']).to be_presentendenddiff --git a/backend/engines/api/spec/controllers/spree/api/v3/store/wishlist_items_controller_spec.rb b/backend/engines/api/spec/controllers/spree/api/v3/store/wishlist_items_controller_spec.rbindex 6dd4157e0f..be675960e3 100644--- a/backend/engines/api/spec/controllers/spree/api/v3/store/wishlist_items_controller_spec.rb+++ b/backend/engines/api/spec/controllers/spree/api/v3/store/wishlist_items_controller_spec.rb@@ -33,7 +33,7 @@ RSpec.describe Spree::Api::V3::Store::WishlistItemsController, type: :controllerit 'returns errors for missing variant_id' dopost :create, params: { wishlist_id: wishlist.prefixed_id, quantity: 1 }- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)expect(json_response['error']['code']).to eq('validation_error')expect(json_response['error']['message']).to be_presentend@@ -41,7 +41,7 @@ RSpec.describe Spree::Api::V3::Store::WishlistItemsController, type: :controllerit 'returns errors for invalid variant_id' dopost :create, params: { wishlist_id: wishlist.prefixed_id, variant_id: 0, quantity: 1 }- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)expect(json_response['error']['code']).to eq('validation_error')expect(json_response['error']['details']['variant']).to be_presentend@@ -92,7 +92,7 @@ RSpec.describe Spree::Api::V3::Store::WishlistItemsController, type: :controllerit 'returns errors for invalid quantity' dopatch :update, params: { wishlist_id: wishlist.prefixed_id, id: wished_item.prefixed_id, quantity: 0 }- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)expect(json_response['error']['code']).to eq('validation_error')expect(json_response['error']['details']['quantity']).to be_presentenddiff --git a/backend/engines/api/spec/controllers/spree/api/v3/store/wishlists_controller_spec.rb b/backend/engines/api/spec/controllers/spree/api/v3/store/wishlists_controller_spec.rbindex 39c62ae2cc..9da514e89f 100644--- a/backend/engines/api/spec/controllers/spree/api/v3/store/wishlists_controller_spec.rb+++ b/backend/engines/api/spec/controllers/spree/api/v3/store/wishlists_controller_spec.rb@@ -106,7 +106,7 @@ RSpec.describe Spree::Api::V3::Store::WishlistsController, type: :controller doit 'returns errors for blank name' dopost :create, params: { name: '' }- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)expect(json_response['error']['code']).to eq('validation_error')expect(json_response['error']['message']).to be_presentexpect(json_response['error']['details']['name']).to be_present@@ -137,7 +137,7 @@ RSpec.describe Spree::Api::V3::Store::WishlistsController, type: :controller doit 'returns errors for blank name' dopatch :update, params: { id: wishlist.prefixed_id, name: '' }- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)expect(json_response['error']['code']).to eq('validation_error')expect(json_response['error']['details']['name']).to be_presentenddiff --git a/docs/developer/tutorial/testing.mdx b/docs/developer/tutorial/testing.mdxindex a985acbe2a..ddf2ce4b11 100644--- a/docs/developer/tutorial/testing.mdx+++ b/docs/developer/tutorial/testing.mdx@@ -278,7 +278,7 @@ RSpec.describe Spree::Admin::BrandsController, type: :controller doit 'returns unprocessable entity status' dopost :create, params: invalid_params- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:unprocessable_content)endendend