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

udpate timestamps instead of travel_to

Bruno Pagno3e8ad156099b
diff --git a/spec/features/activities/work_package/activities_spec.rb b/spec/features/activities/work_package/activities_spec.rb
index e9907ad4664..681a67709f4 100644
--- a/spec/features/activities/work_package/activities_spec.rb
+++ b/spec/features/activities/work_package/activities_spec.rb
@@ -341,7 +341,6 @@ RSpec.describe "Work package activity", :js, :with_cuprite do
end
wp_page.update_attributes(subject: "A new subject") # rubocop:disable Rails/ActiveRecordAliases
- wait_for_network_idle
wp_page.expect_and_dismiss_toaster(message: "Successful update.")
second_journal = work_package.journals.second
@@ -360,11 +359,13 @@ RSpec.describe "Work package activity", :js, :with_cuprite do
activity_tab.expect_journal_notes(text: "First comment")
end
- travel_to (Setting.journal_aggregation_time_minutes.to_i.minutes + 1.minute).from_now
- # the journals will not be merged due to the time difference
+ # make sure the updated happens after aggregation time
+ aggregation_time = Setting.journal_aggregation_time_minutes.to_i.minutes.ago
+ first_journal.update!(updated_at: aggregation_time - 2.minutes)
+ second_journal.update!(updated_at: aggregation_time - 1.minute)
+ # we attempted this with travel_to and that happens to be quite flaky
wp_page.update_attributes(subject: "A new subject!!!") # rubocop:disable Rails/ActiveRecordAliases
- wait_for_network_idle
third_journal = work_package.journals.third