Testing rendering of a given layout with RSpec & Rails

后端 未结 11 1434
滥情空心
滥情空心 2020-12-24 12:31

Is it possible to test the use of a given layout using RSpec with Rails, for example I\'d like a matcher that does the following:

response.should use_layout(         


        
11条回答
  •  南方客
    南方客 (楼主)
    2020-12-24 13:06

    David Chelimsky posted a good answer over on the Ruby Forum:

    response.should render_template("layouts/some_layout")
    

提交回复
热议问题