This project is archived and is in readonly mode.

#3757 ✓resolved
Sam Ruby

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
Finished in 0.185194 seconds.
  1) Error:
NoMethodError: undefined method `ascii_only?' for #<Array:0x7f83f1bac788>
  2) Error:
NoMethodError: undefined method `ascii_only?' for #<Array:0x7f83f1b9d058>
3 tests, 5 assertions, 0 failures, 2 errors

Comments and changes to this ticket

  • José Valim

    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

    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 Lindsaar

    Mikel Lindsaar January 22nd, 2010 @ 02:23 AM

    OK... now that is fixed, the following errors:

    assert_equal @expected.encoded, OrderMailer.create_sent(

    This is because Mail inserts unique message ids on all email objects.

    Changing it to:

    assert_equal @expected, OrderMailer.create_sent(
    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 Lindsaar

    Mikel Lindsaar January 22nd, 2010 @ 02:34 AM

    • Assigned user changed from “Mikel Lindsaar” to “José Valim”

    Jose, I just pushed #c9dc1ac to 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 Lindsaar

    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 Lindsaar

    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

  • Jeremy Kemper

    Jeremy Kemper October 15th, 2010 @ 11:01 PM

    • Milestone set to 3.0.2

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=""></a>

People watching this ticket