I have the following action written:
# POST /designers.xml;contact
def contact
begin
DesignerMailer.deliver_contact(params)
rescue Exception => e
logger.error("Email from #{params[:fromEmail]} to
#{params[:toEmail]} errored with: #{e}")
respond_to do |format|
format.xml { render :xml => e.to_xml }
end
else
respond_to do |format|
format.xml { head :ok }
end
end
end
As you can see, I follow a different path if there are errors in email
delivery. My question?
How do I force that exception in a functional test? A simple mock is
not sufficient since I only want the exception to occur in one of my
tests. I''ve looked at the following code, but I''m not sure it
fits
what I need to do:
http://snippets.dzone.com/posts/show/1872
http://project.ioni.st/post/692#post-692
Thanks in advance!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---