如果有人能帮忙/解释一下,我将不胜感激。
我试着用shoulda测试一个控制器,看看是否使用了正确的布局。
方法should_render_with_layout抛出一个NoMethodError,同时should render_with_layout passes但表示函数被延迟。
任何帮助都将不胜感激。。
谢谢
马特
最佳答案
感谢tsdbrown的回复我跑的应该是2.10.2我已经设法解决了这个问题。我没有启动get请求,但是在添加get请求以设置之后,下面的测试现在通过了谢谢你的帮助。
context "getting index" do
setup do
get :index
end
should_respond_with :success
should_render_with_layout :admin
should_render_template :index
should_assign_to :venue, :class => Venue
should_not_set_the_flash
end