Skip to content

Commit 353dd06

Browse files
committed
Move erb to slim and add html
1 parent 70d48f7 commit 353dd06

File tree

4 files changed

+14
-17
lines changed

4 files changed

+14
-17
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
h3 = t('.prolog')
2+
p = @reported_content.question
3+
p = t('.take_action')
4+
p = request_for_comment_url(@reported_content)

app/views/report_mailer/report_content.text.erb

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
== t('.prolog')
2+
== "\n\n"
3+
== @reported_content.question
4+
== "\n\n"
5+
== t('.take_action')
6+
== "\n\n"
7+
== request_for_comment_url(@reported_content)

spec/mailers/report_mailer_spec.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,20 @@
66
describe '#report_content' do
77
subject(:mail) { described_class.with(reported_content:).report_content }
88

9-
let(:reported_content) { create(:comment, text: 'Inappropriate content for Comment.') }
9+
let(:reported_content) { create(:rfc, question: 'Inappropriate content for RfC.') }
1010

1111
it 'sets the correct sender' do
1212
expect(mail.from).to include('[email protected]')
1313
end
1414

1515
context 'when a RfC is reported' do
16-
let(:reported_content) { create(:rfc, question: 'Inappropriate content for RfC.') }
17-
1816
it 'sets the correct subject' do
1917
expect(mail.subject).to eq(I18n.t('report_mailer.report_content.subject', content_name: RequestForComment.model_name.human))
2018
end
2119

2220
it 'includes the reported content' do
23-
expect(mail.body).to include('Inappropriate content for RfC.')
21+
expect(mail.text_part.body).to include('Inappropriate content for RfC.')
22+
expect(mail.html_part.body).to include('Inappropriate content for RfC.')
2423
end
2524
end
2625
end

0 commit comments

Comments
 (0)