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 null values in journal specs
ulferts5fefc4cce097
diff --git a/spec/factories/journal/message_journal_factory.rb b/spec/factories/journal/message_journal_factory.rbindex 929ae79c73e..cc0062c4b69 100644--- a/spec/factories/journal/message_journal_factory.rb+++ b/spec/factories/journal/message_journal_factory.rb@@ -28,5 +28,6 @@FactoryBot.define dofactory :journal_message_journal, class: 'Journal::MessageJournal' do+ subject { 'abc' }endenddiff --git a/spec/factories/journal/news_journal_facctory.rb b/spec/factories/journal/news_journal_factory.rbsimilarity index 96%rename from spec/factories/journal/news_journal_facctory.rbrename to spec/factories/journal/news_journal_factory.rbindex 51eb36a66e4..952ee253a9a 100644--- a/spec/factories/journal/news_journal_facctory.rb+++ b/spec/factories/journal/news_journal_factory.rb@@ -28,5 +28,7 @@FactoryBot.define dofactory :journal_news_journal, class: 'Journal::NewsJournal' do+ title { 'abc' }+ comments_count { 4 }endenddiff --git a/spec/factories/journal/work_package_journal_factory.rb b/spec/factories/journal/work_package_journal_factory.rbindex 01f37e7f135..4f58bf5f444 100644--- a/spec/factories/journal/work_package_journal_factory.rb+++ b/spec/factories/journal/work_package_journal_factory.rb@@ -32,10 +32,12 @@ FactoryBot.define do# The following properties are not actually valid.# They were added when the default value (also 0) was removed and too many# tests relied on this behaviour for it to be fixed right away.+ subject { 'abc' }type_id { 0 }project_id { 0 }status_id { 0 }priority_id { 0 }author_id { 0 }+ done_ratio { 0 }endenddiff --git a/spec/services/principals/replace_references_service_call_integration_spec.rb b/spec/services/principals/replace_references_service_call_integration_spec.rbindex 22d1ad78725..3f214ac1914 100644--- a/spec/services/principals/replace_references_service_call_integration_spec.rb+++ b/spec/services/principals/replace_references_service_call_integration_spec.rb@@ -150,7 +150,13 @@ describe Principals::ReplaceReferencesService, '#call', type: :model do:journal_attachment_journal,:author_id dolet(:attributes) do- {}+ {+ filename: "'abc.txt'",+ disk_filename: "'abc.txt'",+ filesize: 123,+ digest: "'qwerty'",+ downloads: 5+ }endendend@@ -193,8 +199,10 @@ describe Principals::ReplaceReferencesService, '#call', type: :model doString dolet(:user_cf) { create(:user_wp_custom_field) }let(:attributes) do- { journal_id: 1,- custom_field_id: user_cf.id }+ {+ journal_id: 1,+ custom_field_id: user_cf.id+ }endendend@@ -226,7 +234,10 @@ describe Principals::ReplaceReferencesService, '#call', type: :model do:message,:author_id dolet(:attributes) do- { forum_id: 1 }+ {+ forum_id: 1,+ subject: "'abc'"+ }endend@@ -234,7 +245,10 @@ describe Principals::ReplaceReferencesService, '#call', type: :model do:journal_message_journal,:author_id dolet(:attributes) do- { forum_id: 1 }+ {+ forum_id: 1,+ subject: "'abc'"+ }endendend@@ -274,8 +288,10 @@ describe Principals::ReplaceReferencesService, '#call', type: :model do:meeting_participant,:user_id dolet(:attributes) do- { created_at: 'NOW()',- updated_at: 'NOW()' }+ {+ created_at: 'NOW()',+ updated_at: 'NOW()'+ }endendend@@ -289,7 +305,10 @@ describe Principals::ReplaceReferencesService, '#call', type: :model do:journal_news_journal,:author_id dolet(:attributes) do- {}+ {+ title: "'abc'",+ comments_count: 5+ }endendend@@ -299,8 +318,10 @@ describe Principals::ReplaceReferencesService, '#call', type: :model do:wiki_content,:author_id dolet(:attributes) do- { page_id: 1,- lock_version: 5 }+ {+ page_id: 1,+ lock_version: 5+ }endend@@ -326,7 +347,9 @@ describe Principals::ReplaceReferencesService, '#call', type: :model dotype_id: type.id,status_id: status.id,priority_id: priority.id,- author_id: author.id+ author_id: author.id,+ subject: "'abc'",+ done_ratio: 0}end@@ -347,8 +370,11 @@ describe Principals::ReplaceReferencesService, '#call', type: :model do:assigned_to_id dolet(:attributes) do{- # ignore_non_working_days is non nullable. This part is not related to the test.+ # This part is not related to the test but the columns are non nullable.ignore_non_working_days: false,+ subject: "'abc'",+ done_ratio: 5,+ # End non relevant.project_id: project.id,type_id: type.id,status_id: status.id,@@ -363,8 +389,11 @@ describe Principals::ReplaceReferencesService, '#call', type: :model do:responsible_id dolet(:attributes) do{- # ignore_non_working_days is non nullable. This part is not related to the test.+ # This part is not related to the test but the columns are non nullable.ignore_non_working_days: false,+ subject: "'abc'",+ done_ratio: 5,+ # End non relevant.project_id: project.id,type_id: type.id,status_id: status.id,