This project is archived and is in readonly mode.
undefined method `ascii_only?' running mailer generated tests
Reported by Sam Ruby | January 20th, 2010 @ 05:45 PM | in 3.0.2
Reproduction instructions:
ruby script/generate mailer OrderMailer confirm sent
rake test:functionals
Loaded suite /home/rubys/.rvm/gems/ruby-1.8.7-p248/gems/rake-0.8.7/lib/rake/rake_test_loader
Started
.EE
Finished in 0.185194 seconds.
1) Error:
test_confirm(OrderMailerTest):
NoMethodError: undefined method `ascii_only?' for #<Array:0x7f83f1bac788>
2) Error:
test_sent(OrderMailerTest):
NoMethodError: undefined method `ascii_only?' for #<Array:0x7f83f1b9d058>
3 tests, 5 assertions, 0 failures, 2 errors
Comments and changes to this ticket
-
José Valim January 20th, 2010 @ 06:14 PM
- Assigned user changed from José Valim to Mikel Lindsaar
Assigning to Mikel. We should get this fixed and the new DSL merged next week.
-
Mikel Lindsaar January 22nd, 2010 @ 02:14 AM
This is now fixed in the latest version of Mail (to be released next week with the new ActionMailer API).
This is because the functional test has read_fixture('name') returning an Array, instead of just a plain string.
I have accommodated it in Mail because I can see someone at some point doing:
mail.body = IO.readlines(filename)
But not quite sure we are using read_fixture to return an array instead of just a string... I think the test should be updated to supply mail.body with a string. What do you think Sam?
Mikel
-
Mikel Lindsaar January 22nd, 2010 @ 02:23 AM
OK... now that is fixed, the following errors:
assert_equal @expected.encoded, OrderMailer.create_sent(@expected.date).encoded
This is because Mail inserts unique message ids on all email objects.
Changing it to:
assert_equal @expected, OrderMailer.create_sent(@expected.date) @@ Tests the same thing and will work (as mail will ignore a diff on message-id if EVERYTHING else is the same. Should I make the change to the generator? Mikel
-
Mikel Lindsaar January 22nd, 2010 @ 02:34 AM
- Assigned user changed from Mikel Lindsaar to José Valim
Jose, I just pushed #c9dc1ac to github.com/mikel/rails which has the fix for the functional test, can you commit?
The body.to_s thing will "just work" when we release Mail 2.0.x this weekend
Assign it back to me after the commit and I'll close it when I confirm with the new Mail gem that the other issue is fixed.
Mikel
-
Mikel Lindsaar January 22nd, 2010 @ 02:35 AM
Or we can just hold off until we merge my mikel/rails fork back into master... lets do that.
Mikel
-
Mikel Lindsaar January 24th, 2010 @ 08:05 AM
- State changed from open to resolved
- Assigned user changed from José Valim to Mikel Lindsaar
This is fixed Mail 2.0
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>