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

attempt to stabilize activity revisions spec

ulfertsb46bdfbda341
diff --git a/spec/features/work_packages/tabs/activity_revisions_spec.rb b/spec/features/work_packages/tabs/activity_revisions_spec.rb
index 0c73710e7cc..b9f692025b8 100644
--- a/spec/features/work_packages/tabs/activity_revisions_spec.rb
+++ b/spec/features/work_packages/tabs/activity_revisions_spec.rb
@@ -4,10 +4,10 @@ require 'features/work_packages/work_packages_page'
require 'support/edit_fields/edit_field'
describe 'Activity tab', js: true, selenium: true do
- def alter_work_package_at(work_package, attributes:, at:, user: User.current)
+ def alter_work_package_at(work_package, attributes:, at:, user:)
work_package.update(attributes.merge(updated_at: at))
- note_journal = work_package.journals.last
+ note_journal = work_package.journals.reorder(:id).last
note_journal.update(created_at: at, updated_at: at, user:)
end
@@ -19,9 +19,9 @@ describe 'Activity tab', js: true, selenium: true do
subject: initial_subject,
journal_notes: initial_comment)
- note_journal = work_package.journals.last
- note_journal.update(created_at: 5.days.ago.to_date.to_s,
- updated_at: 5.days.ago.to_date.to_s)
+ note_journal = work_package.journals.reorder(:id).last
+ note_journal.update(created_at: 5.days.ago.to_date.to_fs(:db),
+ updated_at: 5.days.ago.to_date.to_fs(:db))
work_package
end
@@ -43,7 +43,7 @@ describe 'Activity tab', js: true, selenium: true do
at: 3.days.ago.to_date.to_fs(:db),
user:)
- work_package.journals.last
+ work_package.journals.reorder(:id).last
end
let!(:note2) do
@@ -54,7 +54,7 @@ describe 'Activity tab', js: true, selenium: true do
at: 1.day.ago.to_date.to_fs(:db),
user: create(:admin))
- work_package.journals.last
+ work_package.journals.reorder(:id).last
end
let!(:revision) do