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
Test admin-only boolean being saved correctly.
Dombi Attila9355fa1de34b
diff --git a/app/models/permitted_params.rb b/app/models/permitted_params.rbindex 4117169935a..6507f0ae91d 100644--- a/app/models/permitted_params.rb+++ b/app/models/permitted_params.rb@@ -472,7 +472,7 @@ class PermittedParams:possible_values,:regexp,:searchable,- :visible,+ :admin_only,:default_value,:possible_values,:multi_value,diff --git a/spec/features/admin/project_custom_fields/create_spec.rb b/spec/features/admin/project_custom_fields/create_spec.rbindex d622dbb4ea3..ea874cdf6d4 100644--- a/spec/features/admin/project_custom_fields/create_spec.rb+++ b/spec/features/admin/project_custom_fields/create_spec.rb@@ -62,6 +62,7 @@ RSpec.describe "Create project custom fields", :js dofill_in("custom_field_name", with: "New custom field")select(section_for_select_fields.name, from: "custom_field_custom_field_section_id")+ check "Admin-only"click_on("Save")@@ -74,6 +75,7 @@ RSpec.describe "Create project custom fields", :js dolatest_custom_field = ProjectCustomField.reorder(created_at: :asc).lastexpect(latest_custom_field.name).to eq("New custom field")+ expect(latest_custom_field.admin_only).to be(true)expect(latest_custom_field.project_custom_field_section).to eq(section_for_select_fields)enddiff --git a/spec/models/permitted_params_spec.rb b/spec/models/permitted_params_spec.rbindex e297452d93f..7d6f72355f0 100644--- a/spec/models/permitted_params_spec.rb+++ b/spec/models/permitted_params_spec.rb@@ -301,7 +301,7 @@ RSpec.describe PermittedParams dolet(:attribute) { :custom_field }let(:hash) do- { "editable" => "0", "visible" => "0" }+ { "editable" => "0", "admin_only" => "0" }endit_behaves_like "allows params"