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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Fix flaky spec
Christophe Bliard2ac9ac9e9b81
diff --git a/spec/services/work_packages/update_service_integration_spec.rb b/spec/services/work_packages/update_service_integration_spec.rbindex 9ea6044bdf6..266e669d5e2 100644--- a/spec/services/work_packages/update_service_integration_spec.rb+++ b/spec/services/work_packages/update_service_integration_spec.rb@@ -64,7 +64,7 @@ RSpec.describe WorkPackages::UpdateService, "integration", type: :model doset_factory_default(:user, user)end- shared_let(:work_package, refind: true, reload: false) do+ let(:work_package) docreate(:work_package,subject: "work_package")enddiff --git a/spec/support/table_helpers/table_data.rb b/spec/support/table_helpers/table_data.rbindex e30841aa879..409c50f4ff7 100644--- a/spec/support/table_helpers/table_data.rb+++ b/spec/support/table_helpers/table_data.rb@@ -143,6 +143,7 @@ module TableHelpersenddef create+ warn_for_existing_work_packages_with_same_identifiertable_data.work_package_identifiers.each do |identifier|create_work_package(identifier)end@@ -153,6 +154,18 @@ module TableHelpers[work_packages_by_identifier, relations]end+ def warn_for_existing_work_packages_with_same_identifier+ existing_identifiers = WorkPackage.pluck(:subject).map { |subject| to_identifier(subject) }+ identical_identifiers = existing_identifiers & table_data.work_package_identifiers+ if identical_identifiers.any?+ puts <<~MESSAGE+ [let_work_packages] Warning: existing work packages with identical identifiers found: #{identical_identifiers.map(&:inspect).join(', ')}+ [let_work_packages] This can cause failures when checking work package with `expect_work_packages(WorkPackage.all)`."+ [let_work_packages] Current example is #{RSpec.current_example.description.inspect} at #{RSpec.current_example.location}+ MESSAGE+ end+ end+def create_work_package(identifier)@work_packages_by_identifier[identifier] ||= beginattributes = work_package_attributes(identifier)