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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Uncheck workflow status checkbox by default
Oliver Güntherad339e14a0d3
diff --git a/app/controllers/workflows_controller.rb b/app/controllers/workflows_controller.rbindex aec51ef4790..bf78196c288 100644--- a/app/controllers/workflows_controller.rb+++ b/app/controllers/workflows_controller.rb@@ -45,7 +45,7 @@ class WorkflowsController < ApplicationControllerenddef edit- @used_statuses_only = params[:used_statuses_only] != "0"+ @used_statuses_only = params[:used_statuses_only] == "1"statuses_for_formdiff --git a/spec/controllers/workflows_controller_spec.rb b/spec/controllers/workflows_controller_spec.rbindex 74e6d004584..36db16147ce 100644--- a/spec/controllers/workflows_controller_spec.rb+++ b/spec/controllers/workflows_controller_spec.rb@@ -156,44 +156,49 @@ RSpec.describe WorkflowsController doendend- context "with role and type params" do+ context "with role and type params, and only used statuses" dobefore do- get :edit, params: { role_id: role.id.to_s, type_id: type.id.to_s }+ get :edit, params: { role_id: role.id.to_s, type_id: type.id.to_s, used_statuses_only: "1" }end- it "is successful" do+ it "is responds with the statuses", :aggregate_failures doexpect(response).to have_http_status(:ok)- end-- it "renders the edit template" doexpect(response).to render_template :edit- end-- it "assigns role" doexpect(assigns[:role]).to eq role- end-- it "assign type" doexpect(assigns[:type]).to eq type- end-- it "assigns roles" doexpect(assigns[:roles]).to eq [role]- end-- it "assigns types" doexpect(assigns[:types]).to eq [type]+ expect(assigns[:statuses])+ .to eq type.statusesend+ end- it "assigns statuses" do+ context "with role and type params, and no statuses filter" do+ before do+ get :edit, params: { role_id: role.id.to_s, type_id: type.id.to_s }+ end++ it "is responds with the statuses", :aggregate_failures do+ expect(response)+ .to have_http_status(:ok)+ expect(response)+ .to render_template :edit+ expect(assigns[:role])+ .to eq role+ expect(assigns[:type])+ .to eq type+ expect(assigns[:roles])+ .to eq [role]+ expect(assigns[:types])+ .to eq [type]expect(assigns[:statuses])- .to eq type.statuses+ .to eq Status.allendend