Rails + Rspec + Rack + Session testing
Gemfile file: 'rack', '~> 1.6.0' I am having little trouble in passing the session variables from rspec tests to the Rack middleware. I have gone through many articles on internet but there is no solution which can help me to understand. So basically i want to be able to do this in my middleware class req = Rack::Request.new(env) req.session[:token] But currently req.session[:token] comes as empty from my rspec. How can I set session in my R spec class so that i can test different scenario's ? Are there any other examples i missed? Thanks in advance.... 来源: https://stackoverflow.com/questions