Forum: Ruby on Rails How to test a mailer that has a date with accents?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ef8e27e76850a35bbf6738785b7f207b?d=identicon&s=25 David M (Guest)
on 2012-07-19 14:29
(Received via mailing list)
In my mailer I have a date with Spanish format:

sbado, 21 de julio del 2012

I have a custom formatter for that configured in my

my_date_format: ! '%A, %-d de %B del %Y, %k:%M'

I'm trying to test it this way:

test "date with accent" do
  mail = MyMailer.my_template

  assert_match I18n.l(, format: :my_date_format),

But it fails:

# Running tests:


Finished tests in 0.438078s, 2.2827 tests/s, 15.9789 assertions/s.

1) Failure: test_date_with_accent(MyMailerTest)
[test/unit/mailers/my_mailer_test.rb:12]: Expected /sbado,\ 21\ de\
del\ 2012,\ 14:10/ to match "...... .......s=C3=A1bado, 21 de julio del
2012, 14:10\r\n ........".

(I have omitted the rest of the email content)
This topic is locked and can not be replied to.