Testing rendering of a given layout with RSpec & Rails

后端 未结 11 1435
滥情空心
滥情空心 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:07

    I had to write the following to make this work:

    response.should render_template("layouts/some_folder/some_layout", "template-name")
    

提交回复
热议问题