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 spec

Dombi Attila0d3f14301490
diff --git a/app/models/queries/filters/strategies/list.rb b/app/models/queries/filters/strategies/list.rb
index 0a4eaf4d76c..01af460e564 100644
--- a/app/models/queries/filters/strategies/list.rb
+++ b/app/models/queries/filters/strategies/list.rb
@@ -30,6 +30,9 @@
module Queries::Filters::Strategies
class List < BaseStrategy
+ delegate :allowed_values,
+ to: :filter
+
self.supported_operators = ["=", "!"]
self.default_operator = "="
@@ -50,16 +53,12 @@ module Queries::Filters::Strategies
end
end
- def allowed_values
- filter.allowed_values.map { |_, v| v.to_s }
- end
-
def valid_values!
- filter.values &= (allowed_values + ["-1"])
+ filter.values &= (allowed_values.map { |_, v| v.to_s } + ["-1"])
end
def non_valid_values?
- (values.compact_blank & (allowed_values + ["-1"])) != values.compact_blank
+ (values.compact_blank & (allowed_values.map { |_, v| v.to_s } + ["-1"])) != values.compact_blank
end
end
end
diff --git a/spec/models/custom_actions/actions/custom_field_spec.rb b/spec/models/custom_actions/actions/custom_field_spec.rb
index 644856e5988..d1b4d7ce2f7 100644
--- a/spec/models/custom_actions/actions/custom_field_spec.rb
+++ b/spec/models/custom_actions/actions/custom_field_spec.rb
@@ -112,7 +112,7 @@ RSpec.describe CustomActions::Actions::CustomField do
expect(described_class.all.map(&:custom_field))
.to match_array(custom_fields)
- described_class.find_each do |subclass|
+ described_class.all.each do |subclass|
expect(subclass.ancestors).to include(described_class)
end
end