Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix render of categories

Oliver Günther8e253407dae4
diff --git a/app/controllers/categories_controller.rb b/app/controllers/categories_controller.rb
index a9ef1ee1757..e17e18eb5ce 100644
--- a/app/controllers/categories_controller.rb
+++ b/app/controllers/categories_controller.rb
@@ -90,6 +90,7 @@ class CategoriesController < ApplicationController
return
end
@categories = @project.categories - [@category]
+ render status: :unprocessable_entity
end
private
diff --git a/spec/controllers/categories_controller_spec.rb b/spec/controllers/categories_controller_spec.rb
index 648628a7167..65874b67e90 100644
--- a/spec/controllers/categories_controller_spec.rb
+++ b/spec/controllers/categories_controller_spec.rb
@@ -207,7 +207,7 @@ RSpec.describe CategoriesController do
describe "#response" do
subject { response }
- it { is_expected.to be_successful }
+ it { is_expected.to have_http_status(:unprocessable_entity) }
it { is_expected.to render_template("destroy") }
end