Controller spec api improvements
This commit is contained in:
@@ -61,7 +61,7 @@ module Suppliers
|
||||
format.json { render json: @section, serializer: SupplierSectionSerializer, status: :created }
|
||||
else
|
||||
format.html { render action: "new" }
|
||||
format.json { render json: @section.errors, status: :unprocessable_entity }
|
||||
format.json { render json: {errors: @section.errors}, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -77,7 +77,7 @@ module Suppliers
|
||||
format.json { head :no_content }
|
||||
else
|
||||
format.html { render action: "edit" }
|
||||
format.json { render json: @section.errors, status: :unprocessable_entity }
|
||||
format.json { render json: {errors: @section.errors}, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user