Unable to set session hash in Rails 5 controller test

后端 未结 4 1511
醉话见心
醉话见心 2020-12-11 03:23

According to the Rails Edge Guide all ActionDispatch::IntegrationTest HTTP requests take optional named keyword arguments:

get post_url, params: { id: 12 }, se

4条回答
  •  攒了一身酷
    2020-12-11 03:43

    I think you can do as this:

    delete cart_url(@cart), params: { 'session' => { :cart_id => @cart.id }}
    

提交回复
热议问题