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

at_timestamp: rubocop refactoring

Sebastian Fiedlschusterc6a91b74ea78
diff --git a/spec/models/journable/timestamps_spec.rb b/spec/models/journable/timestamps_spec.rb
index fa857285246..67c3332a957 100644
--- a/spec/models/journable/timestamps_spec.rb
+++ b/spec/models/journable/timestamps_spec.rb
@@ -536,7 +536,7 @@ describe Journable::Timestamps do
end
end
- describe "when the sql where statement includes work_package.id" do
+ describe "when the sql where statement includes \"work_package\".\"id\"" do
# This is used in the manual-sorting feature.
subject { WorkPackage.where("(\"work_packages\".\"id\" IN (#{work_package.id}))").at_timestamp(wednesday) }
@@ -620,7 +620,7 @@ describe Journable::Timestamps do
it "transforms the table name" do
expect(subject.to_sql).to include \
- "JOIN \"time_entries\" ON \"time_entries\".\"work_package_id\" = \"journals\".\"journable_id\""
+ "JOIN \"time_entries\" ON \"time_entries\".\"work_package_id\" = \"journals\".\"journable_id\""
end
it "returns the requested work package" do
@@ -630,11 +630,15 @@ describe Journable::Timestamps do
describe "when joining using a manual sql expression" do
# This is used in the manual-sorting feature.
- subject { WorkPackage.joins("LEFT OUTER JOIN ordered_work_packages ON ordered_work_packages.work_package_id = work_packages.id").at_timestamp(wednesday) }
+ subject do
+ WorkPackage \
+ .joins("LEFT OUTER JOIN ordered_work_packages ON ordered_work_packages.work_package_id = work_packages.id") \
+ .at_timestamp(wednesday)
+ end
it "transforms the table name" do
expect(subject.to_sql).to include \
- "LEFT OUTER JOIN ordered_work_packages ON ordered_work_packages.work_package_id = journals.journable_id"
+ "LEFT OUTER JOIN ordered_work_packages ON ordered_work_packages.work_package_id = journals.journable_id"
end
it "returns the requested work package" do