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
[#36559] fix other specs
Tobias Dillmann26f5232b3f96
diff --git a/spec/models/queries/work_packages/selects/custom_field_select_spec.rb b/spec/models/queries/work_packages/selects/custom_field_select_spec.rbindex 0edbeff9a4d..004001de025 100644--- a/spec/models/queries/work_packages/selects/custom_field_select_spec.rb+++ b/spec/models/queries/work_packages/selects/custom_field_select_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+#-- copyright# OpenProject is an open source project management software.# Copyright (C) the OpenProject GmbH@@ -37,20 +39,24 @@ RSpec.describe Queries::WorkPackages::Selects::CustomFieldSelect doit_behaves_like "query column", sortable_by_default: truedescribe "instances" do- let(:text_custom_field) do- create(:text_wp_custom_field)- end+ let(:user) { create(:user) }+ let(:text_custom_field) { create(:text_wp_custom_field) }+ let(:list_custom_field) { create(:list_wp_custom_field) }+ let(:wp_relation) { double }++ current_user { user }- let(:list_custom_field) do- create(:list_wp_custom_field)+ before do+ allow(wp_relation).to receive(:visible_by_user)+ .with(user)+ .and_return([text_custom_field, list_custom_field])endcontext "within project" dobefore doallow(project).to receive(:all_work_package_custom_fields)- .and_return([text_custom_field,- list_custom_field])+ .and_return(wp_relation)endit "contains only non text cf columns" do@@ -62,12 +68,11 @@ RSpec.describe Queries::WorkPackages::Selects::CustomFieldSelect doendend- context "global" do+ context "when global" dobefore doallow(WorkPackageCustomField).to receive(:all)- .and_return([text_custom_field,- list_custom_field])+ .and_return(wp_relation)endit "contains only non text cf columns" dodiff --git a/spec/models/query/results_sums_integration_spec.rb b/spec/models/query/results_sums_integration_spec.rbindex 3cf59e1d657..ad2fa972537 100644--- a/spec/models/query/results_sums_integration_spec.rb+++ b/spec/models/query/results_sums_integration_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+#-- copyright# OpenProject is an open source project management software.# Copyright (C) the OpenProject GmbH@@ -136,7 +138,7 @@ RSpec.describe Query::Results, "sums" docreate(:user, member_with_permissions: { project => permissions })endlet(:permissions) do- %i[view_work_packages view_cost_entries view_time_entries view_cost_rates view_hourly_rates]+ %i[view_work_packages view_cost_entries view_time_entries view_cost_rates view_hourly_rates select_custom_fields]endlet(:group_by) { nil }let(:query) do