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

Fix tests and make rubocop happy

Mir Bhatia40080e9d6e21
diff --git a/lib/open_project/journal_formatter/subproject_named_association.rb b/lib/open_project/journal_formatter/subproject_named_association.rb
index 420d88d5691..911ba86f60d 100644
--- a/lib/open_project/journal_formatter/subproject_named_association.rb
+++ b/lib/open_project/journal_formatter/subproject_named_association.rb
@@ -29,13 +29,13 @@ class OpenProject::JournalFormatter::SubprojectNamedAssociation < JournalFormatt
private
def format_details(key, values, cache:)
- if values.first.nil?
- label = label(key)
- elsif values.last.nil?
- label = I18n.t("activerecord.attributes.project.parent_no_longer")
- else
- label = I18n.t("activerecord.attributes.project.parent_without_of")
- end
+ label = if values.first.nil?
+ label(key)
+ elsif values.last.nil?
+ I18n.t("activerecord.attributes.project.parent_no_longer")
+ else
+ I18n.t("activerecord.attributes.project.parent_without_of")
+ end
old_value, value = *format_values(values, key, cache:)
diff --git a/spec/features/activities/project_attributes_activity_spec.rb b/spec/features/activities/project_attributes_activity_spec.rb
index e7df5c06c8e..8883c291e1e 100644
--- a/spec/features/activities/project_attributes_activity_spec.rb
+++ b/spec/features/activities/project_attributes_activity_spec.rb
@@ -89,7 +89,7 @@ describe 'Project attributes activities' do
expect(page).to have_selector('li', text: "Name changed from #{previous_project_attributes['name']} to #{project.name}")
expect(page).to have_selector('li', text: 'Description set (Details)')
expect(page).to have_selector('li', text: 'Visibility set to public')
- expect(page).to have_selector('li', text: "Subproject of deleted (#{parent_project.name})")
+ expect(page).to have_selector('li', text: "No longer subproject of #{parent_project.name}")
expect(page).to have_selector('li', text: 'Project unarchived')
expect(page).to have_selector('li', text: "Identifier changed from #{previous_project_attributes['identifier']} " \
"to #{project.identifier}")