在我的ApplicationController中,我有一个定义为助手方法的方法:
helper_method :some_method_here
- 如何在RSpec中测试ApplicationController?
- 在测试视图/帮助程序时,如何包含/调用此帮助程序方法?
I'm using Rails3 with RSpec2
在我的ApplicationController中,我有一个定义为助手方法的方法:
helper_method :some_method_here
I'm using Rails3 with RSpec2
您可以使用anonymous controller来测试ApplicationController,如RSpec文档中所述.还有一节是关于testing helpers的.