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
avoid flickering spec caused by factorybot on wrong schema
ulfertsfdd33565d7a5
diff --git a/spec/migrations/add_primary_key_to_custom_fields_projects_spec.rb b/spec/migrations/add_primary_key_to_custom_fields_projects_spec.rbindex bc34d92112f..0c7da8bb333 100644--- a/spec/migrations/add_primary_key_to_custom_fields_projects_spec.rb+++ b/spec/migrations/add_primary_key_to_custom_fields_projects_spec.rb@@ -31,13 +31,18 @@ require Rails.root.join("db/migrate/20240917105829_add_primary_key_to_custom_fieRSpec.describe AddPrimaryKeyToCustomFieldsProjects, type: :model doshared_association_default(:project) { create(:project) }+ let(:custom_fields) { create_list(:custom_field, 5) }it "adds an `id` primary key column with backfilled values" doActiveRecord::Migration.suppress_messages { described_class.migrate(:down) }CustomFieldsProject.reset_column_informationCustomFieldsProject.reset_primary_key- create_list(:custom_fields_project, 5)+ # Avoid using factory bot here as the factory will already expect an id column if any+ # test using the factory has run before.+ CustomFieldsProject.insert_all(+ custom_fields.map { |cf| { project_id: project.id, custom_field_id: cf.id } }+ )aggregate_failures "no primary key column" doexpect(CustomFieldsProject.column_names).not_to include("id")