2

如果有人可以帮助/解释以下内容,我将不胜感激。

我正在尝试使用 shoulda 测试控制器以查看是否使用了正确的布局。

方法 should_render_with_layout 抛出 NoMethodError 而应该 render_with_layout 通过但表示该函数被延迟。

任何帮助将不胜感激。谢谢马特

4

1 回答 1

0

并感谢 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
于 2010-02-09T14:44:43.980 回答