This project is archived and is in readonly mode.

#2004 ✓invalid
Thibaud Guillaume-Gentil

ActionMailer content_type bug with 2.3 RC1

Reported by Thibaud Guillaume-Gentil | February 18th, 2009 @ 08:03 AM | in 2.x

I have a bug in my specs when ActionMailer tries to render_message.

wrong number of arguments (0 for 1)
/Library/Ruby/Gems/1.8/gems/actionmailer-2.3.0/lib/action_mailer/base.rb:548:in `content_type'
/Library/Ruby/Gems/1.8/gems/actionmailer-2.3.0/lib/action_mailer/base.rb:548:in `render_message'
/Library/Ruby/Gems/1.8/gems/actionmailer-2.3.0/lib/action_mailer/base.rb:491:in `create!'
/Library/Ruby/Gems/1.8/gems/actionmailer-2.3.0/lib/action_mailer/base.rb:450:in `initialize'
/Library/Ruby/Gems/1.8/gems/actionmailer-2.3.0/lib/action_mailer/base.rb:393:in `new'
/Library/Ruby/Gems/1.8/gems/actionmailer-2.3.0/lib/action_mailer/base.rb:393:in `method_missing'

method_name respond_to :content_type, but method_name.content_type return nothing (not even nil)

@@@ Ruby

  def render_message(method_name, body)
    if method_name.respond_to?(:content_type)
      @current_template_content_type = method_name.content_type  # line 548 here
    render :file => method_name, :body => body
    @current_template_content_type = nil

config.action_mailer.delivery_method is set to: :test
When I comment the line 548, this bug doesn't occur anymore but specs are very slow to execute.

I use the edge version of RSpec, but this bug is present too with the last official release of RSpec (1.1.12). I don't think this is related with RSpec.

Comments and changes to this ticket

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>