Testing a Sinatra application that uses session

后端 未结 4 1101
粉色の甜心
粉色の甜心 2021-01-03 05:23

How to test Sinatra application which is using session?

get "/", {}, {\'rack.session\' =>  { \'foo\' => \'blah\' } }

This cod

4条回答
  •  孤城傲影
    2021-01-03 06:20

    Like Philip suggested, it would work better to manually set the session variable before the get request.

    session[:foo] = 'blah'
    get "/"
    

提交回复
热议问题