Skip to content

Commit e699c60

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

File tree

4 files changed

+20
-16
lines changed

4 files changed

+20
-16
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
h3 = t('.prolog')
2+
- case @reported_content
3+
- when RequestForComment
4+
p = @reported_content.question
5+
p = t('.take_action')
6+
p = request_for_comment_url(@reported_content)
7+
- else
8+
- raise("Unexpected reported content: #{@reported_content.class.name}")

app/views/report_mailer/report_content.text.erb

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
== t('.prolog')
2+
== "\n\n"
3+
- case @reported_content
4+
- when RequestForComment
5+
== @reported_content.question
6+
== "\n\n"
7+
== t('.take_action')
8+
== "\n\n"
9+
== request_for_comment_url(@reported_content)
10+
- else
11+
- raise("Unexpected reported content: #{@reported_content.class.name}")

spec/mailers/report_mailer_spec.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@
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

0 commit comments

Comments
 (0)