This project is archived and is in readonly mode.
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
end
render :file => method_name, :body => body
ensure
@current_template_content_type = nil
end
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
-
Jørgen Orehøj Erichsen February 18th, 2009 @ 08:45 PM
I had the same problem. Turns out it's the problem described here:
From http://devblog.michaelgalero.com...
"Because when you generated the users_controller_spec.rb using the generator of the Restful Authentication plugin, the comment said you should move the include AuthenticatedTestHelper to spec_helper.rb. And you did. And the AuthenticatedTestHelper module defines a content_type method with 1 argument that gets added to the Object class."
-
Thibaud Guillaume-Gentil February 19th, 2009 @ 08:09 AM
Great removing AuthenticatedTestHelper fix the problem, thank Jørgen!
But now, my specs are quite slower each time that a email is delivered, any ideas why?
-
CancelProfileIsBroken April 22nd, 2009 @ 10:14 PM
- State changed from new to invalid
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>