2012-09-18 37 views
0

出於某種原因,我的幫助器方法在視圖中不可用我的Resque工作人員按功能測試的規定執行。輔助方法在功能測試中的Resque Workers中是否不可用?

我想知道是否有人注意到了這一點,以及可能的解決方法是什麼?

在我的測試:

assert_queued(EmailTemplatePdfWorker) 
Resque.run! 

在由email_template_pdf_worker.rb渲染我的視圖:

- raise 'this seriously does not work' if !(defined? newline_to_br) 

*其中newline_to_br是在我的application_helper.rb中定義的方法。

任何想法?

回答

1

這聽起來像你沒有加載你想在你的郵件程序使用視圖助手:

class EmailTemplatePdfWorker < ActionMailer::Base 
    add_template_helper(ApplicationHelper) 

    #... 
end 
+0

我曾想過這一點,但它並沒有足夠。謝謝Winfield! – Trip