Uncapitalize type if trying to find translation-string
Signed-off-by: Lukas Matt <lukas@zauberstuhl.de>
This commit is contained in:
parent
e2d895c636
commit
74fbd122a1
2 changed files with 11 additions and 1 deletions
|
|
@ -8,7 +8,7 @@ class ReportMailer < ActionMailer::Base
|
||||||
def new_report(type, id, role)
|
def new_report(type, id, role)
|
||||||
resource = {
|
resource = {
|
||||||
url: report_index_url,
|
url: report_index_url,
|
||||||
type: I18n.t("notifier.report_email.type." + type),
|
type: I18n.t("notifier.report_email.type.#{type.downcase}"),
|
||||||
id: id
|
id: id
|
||||||
}
|
}
|
||||||
person = Person.find(role.person_id)
|
person = Person.find(role.person_id)
|
||||||
|
|
|
||||||
|
|
@ -37,5 +37,15 @@ describe Report, type: :mailer do
|
||||||
expect(ActionMailer::Base.deliveries[0].subject).to match("Ein neuer post wurde als anstößig markiert")
|
expect(ActionMailer::Base.deliveries[0].subject).to match("Ein neuer post wurde als anstößig markiert")
|
||||||
expect(ActionMailer::Base.deliveries[1].subject).to match("A new post was marked as offensive")
|
expect(ActionMailer::Base.deliveries[1].subject).to match("A new post was marked as offensive")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "should find correct post translation" do
|
||||||
|
ReportMailer.new_report("PosT", 666).each(&:deliver_now)
|
||||||
|
expect(ActionMailer::Base.deliveries[0].subject).not_to match("translation missing")
|
||||||
|
end
|
||||||
|
|
||||||
|
it "should find correct comment translation" do
|
||||||
|
ReportMailer.new_report("CoMMenT", 666).each(&:deliver_now)
|
||||||
|
expect(ActionMailer::Base.deliveries[0].subject).not_to match("translation missing")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue