diff --git a/lib/data_breach.rb b/lib/data_breach.rb index 88e3d087..b41a8bde 100644 --- a/lib/data_breach.rb +++ b/lib/data_breach.rb @@ -63,7 +63,8 @@ def data_breach(report, logged_in_user) mail( from: from, to: contact_from_name_and_email, - subject: _('New data breach report'), + subject: _('New data breach report [{{reference}}]', + reference: case_reference('BR')) ) end end diff --git a/spec/integration/report_a_data_breach_spec.rb b/spec/integration/report_a_data_breach_spec.rb index 5692e2b0..1a55fc64 100644 --- a/spec/integration/report_a_data_breach_spec.rb +++ b/spec/integration/report_a_data_breach_spec.rb @@ -36,7 +36,7 @@ last_email = ActionMailer::Base.deliveries.last expect(last_email.from).to eq(['do-not-reply-to-this-address@localhost']) expect(last_email.to).to eq(['postmaster@localhost']) - expect(last_email.subject).to eq('New data breach report') + expect(last_email.subject).to match(/New data breach report \[BR\/.*\]/) expect(last_email.header["Reply-To"].value).to eq('test@example.com') expect(last_email.body).to include('URL: https://example.com') expect(last_email.body).to include('Special category or criminal offence data: Yes')