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

chore[Op#40437]: add timestamp spec

Kabiru Mwenja65c2aa2a210e
diff --git a/spec/models/concerns/reactable_spec.rb b/spec/models/concerns/reactable_spec.rb
index a3b155b0d1a..edb119e63cb 100644
--- a/spec/models/concerns/reactable_spec.rb
+++ b/spec/models/concerns/reactable_spec.rb
@@ -72,6 +72,22 @@ RSpec.describe Reactable do
users: [{ id: user2.id, name: user2.name }]
)
end
+
+ context "when last_updated_at is set" do
+ it "returns grouped emoji reactions for work package journals that were updated after last_updated_at" do
+ wp_journal1.update!(updated_at: 1.day.ago)
+ result = Journal.grouped_work_package_journals_emoji_reactions(work_package, last_updated_at: wp_journal2.updated_at)
+
+ expect(result).to eq(
+ wp_journal2.id => {
+ thumbs_down: {
+ count: 1,
+ users: [{ id: user2.id, name: user2.name }]
+ }
+ }
+ )
+ end
+ end
end
describe ".grouped_journal_emoji_reactions" do