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
Add project journal attribute for name
Mir Bhatiaeedb2372ede0
diff --git a/app/models/project.rb b/app/models/project.rbindex c3932c7ea15..c0ee891023c 100644--- a/app/models/project.rb+++ b/app/models/project.rb@@ -107,6 +107,7 @@ class Project < ApplicationRecordregister_on_journal_formatter(:active_status, 'active')register_on_journal_formatter(:template, 'templated')register_on_journal_formatter(:plaintext, 'identifier')+ register_on_journal_formatter(:plaintext, 'name')has_paper_traildiff --git a/spec/models/journal/project_journal_spec.rb b/spec/models/journal/project_journal_spec.rbindex a0500ec38bc..ee3e05d9bd2 100644--- a/spec/models/journal/project_journal_spec.rb+++ b/spec/models/journal/project_journal_spec.rb@@ -30,10 +30,10 @@ require 'spec_helper'RSpec.describe Journal::ProjectJournal dodescribe '#render_detail' do- it 'renders identifier field correctly' do- project = build(:project)- journal = build(:project_journal, journable: project)+ let(:project) { build(:project) }+ let(:journal) { build(:project_journal, journable: project) }+ it 'renders identifier field correctly' dohtml = journal.render_detail(['identifier', [nil, 'my-project']], html: true)expect(html).to eq('<strong>Identifier</strong> set to ' \'<i title="my-project">my-project</i>')@@ -48,5 +48,21 @@ RSpec.describe Journal::ProjectJournal dohtml = journal.render_detail(['identifier', ['my-project', 'my-beautiful-project']], html: false)expect(html).to eq('Identifier changed from my-project to my-beautiful-project')end++ it 'renders name field correctly' do+ html = journal.render_detail(['name', [nil, 'Test Project 123']], html: true)+ expect(html).to eq('<strong>Name</strong> set to ' \+ '<i title="Test Project 123">Test Project 123</i>')++ html = journal.render_detail(['name', [nil, 'Test Project 123']], html: false)+ expect(html).to eq('Name set to Test Project 123')++ html = journal.render_detail(['name', ['Old Project Name', 'New Project Name']], html: true)+ expect(html).to eq('<strong>Name</strong> changed from <i title="Old Project Name">Old Project Name</i> ' \+ '<strong>to</strong> <i title="New Project Name">New Project Name</i>')++ html = journal.render_detail(['name', ['Old Project Name', 'New Project Name']], html: false)+ expect(html).to eq('Name changed from Old Project Name to New Project Name')+ endendend