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
Adapt test to new email layout
Henriette Darge57e9279434df
diff --git a/config/locales/en.yml b/config/locales/en.ymlindex 77057af0cf9..6794035aaf5 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -1974,7 +1974,7 @@ en:work_packages:comment_added: '<b>Comment</b> added'created: 'Created'- created_at: 'by %{user} %{timestamp} ago'+ created_at: '%{timestamp} ago by %{user} 'login_to_see_all: 'Log in to see all notifications.'more_to_see_singular: 'There is 1 more work package with notifications.'more_to_see_plural: 'There are %{number} more work packages with notifications.'diff --git a/spec/mailers/digest_mailer_spec.rb b/spec/mailers/digest_mailer_spec.rbindex cca14eb1b9c..7eb2eb01822 100644--- a/spec/mailers/digest_mailer_spec.rb+++ b/spec/mailers/digest_mailer_spec.rb@@ -76,7 +76,7 @@ describe DigestMailer, type: :mailer dodescribe '#work_packages' dosubject(:mail) { described_class.work_packages(recipient.id, notifications.map(&:id)) }- let(:mail_body) { mail.body.parts.detect { |part| part['Content-Type'].value == 'text/html' }.body.to_s }+ let(:mail_body) { mail.body.encoded }it 'notes the day and the number of notifications in the subject' doexpect(mail.subject)@@ -104,20 +104,25 @@ describe DigestMailer, type: :mailer do.to eql recipient.nameend- it 'includes the notifications grouped by project and work package' do+ it 'includes the notifications grouped by work package' doexpect(mail_body)- .to have_selector('body section h1', text: project1.name)+ .to have_text("Hey #{recipient.firstname}!")- expected = "#{work_package.type.name} ##{work_package.id} #{work_package.status.name}: #{work_package.subject}"+ expected_notification_subject = "#{work_package.type.name.upcase} #{work_package.subject}"expect(mail_body)- .to have_selector('body section section h2', text: expected)+ .to have_text(expected_notification_subject, normalize_ws: true)+ expected_notification_header = "#{work_package.status.name} ##{work_package.id} - #{work_package.project}"expect(mail_body)- .to have_selector('body section section p.op-uc-p', text: journal.notes)+ .to have_text(expected_notification_header, normalize_ws: true)+ expected_journal_text = "Comment added less than a minute ago by #{recipient.name}"expect(mail_body)- .to have_selector('body section section li',- text: "Subject changed from old subject to new subject")+ .to have_text(expected_journal_text, normalize_ws: true)++ expected_details_text = "Subject changed from old subject to new subject less than a minute ago by #{recipient.name}"+ expect(mail_body)+ .to have_text(expected_details_text, normalize_ws: true)endcontext 'with only a deleted work package for the digest' do