RSpec View testing: How to modify params?

后端 未结 4 562
清歌不尽
清歌不尽 2020-12-31 07:31

I am trying to test my views with RSpec. The particular view that is causing me troubles changes its appearance depending on a url parameter:

link_to \"sort>

4条回答
  •  迷失自我
    2020-12-31 07:53

    Another method of setting view params:

    controller.request.path_parameters[:some_param] = 'a value'
    

提交回复
热议问题