Controller spec api improvements

This commit is contained in:
2014-12-02 19:24:09 +01:00
parent 60e6b2a648
commit a0774caeff
7 changed files with 61 additions and 164 deletions
@@ -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