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 specs for historic relation

Klaus Zandersbeff62ca2031
diff --git a/spec/models/journable/historic_active_record_relation_spec.rb b/spec/models/journable/historic_active_record_relation_spec.rb
index 340838d6d40..6974989e7e2 100644
--- a/spec/models/journable/historic_active_record_relation_spec.rb
+++ b/spec/models/journable/historic_active_record_relation_spec.rb
@@ -168,11 +168,11 @@ RSpec.describe Journable::HistoricActiveRecordRelation do
end
describe "id in subquery (Arel::Nodes::In)" do
- let(:relation) { WorkPackage.where(id: WorkPackage.where(id: [work_package.id, 999, 9999])) }
+ let(:relation) { WorkPackage.where(id: [work_package.id, 99, 999, 9999]) }
describe "#to_sql" do
it "transforms the expression to query the correct table" do
- expect(subject.to_sql).to include "\"journals\".\"journable_id\" IN (SELECT \"work_packages\".\"id\""
+ expect(subject.to_sql).to include "\"journals\".\"journable_id\" IN (#{work_package.id}, 99, 999, 9999)"
end
end