Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

undefined method `ascii_only?' running mailer generated tests

#3757

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

Reported by Sam Ruby · January 20th, 2010 @ 05:45 PM

State: resolved
Milestone: 3.0.2
Assigned to: Mikel Lindsaar Mikel Lindsaar
Importance: none

Activity

  1. José Valim
    José Valim
    • Assigned user changed from José Valim to Mikel Lindsaar

    Assigning to Mikel. We should get this fixed and the new DSL merged next week.

    January 20th, 2010 @ 06:14 PM

  2. Mikel Lindsaar
    Mikel Lindsaar

    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

    January 22nd, 2010 @ 02:14 AM

  3. Mikel Lindsaar
    Mikel Lindsaar

    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
    

    January 22nd, 2010 @ 02:23 AM

  4. Mikel Lindsaar
    Mikel Lindsaar
    • 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

    January 22nd, 2010 @ 02:34 AM

  5. Mikel Lindsaar
    Mikel Lindsaar

    Or we can just hold off until we merge my mikel/rails fork back into master... lets do that.

    Mikel

    January 22nd, 2010 @ 02:35 AM

  6. Mikel Lindsaar
    Mikel Lindsaar
    • State changed from open to resolved
    • Assigned user changed from José Valim to Mikel Lindsaar

    This is fixed Mail 2.0

    January 24th, 2010 @ 08:05 AM

  7. Jeremy Kemper