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 sort criteria spec

Ivan Kuchin4ddc1e603e70
diff --git a/spec/models/query/sort_criteria_spec.rb b/spec/models/query/sort_criteria_spec.rb
index c1444e2ca06..04bf3de1617 100644
--- a/spec/models/query/sort_criteria_spec.rb
+++ b/spec/models/query/sort_criteria_spec.rb
@@ -113,12 +113,8 @@ RSpec.describe Query::SortCriteria do
let(:sort_criteria) { [%w[version desc], %w[start_date asc]] }
it "adds the order handling (and the default order by id)" do
- sort_sql = <<~SQL
- array_remove(regexp_split_to_array(regexp_replace(substring(versions.name from '^[^a-zA-Z]+'), '\\D+', ' ', 'g'), ' '), '')::int[]
- SQL
-
expect(subject)
- .to eq [["#{sort_sql} DESC NULLS LAST", "name DESC NULLS LAST"],
+ .to eq [["name DESC NULLS LAST"],
["work_packages.start_date NULLS LAST"],
["work_packages.id DESC"]]
end