According to the Rails Edge Guide all ActionDispatch::IntegrationTest HTTP requests take optional named keyword arguments:
get post_url, params: { id: 12 }, se
In Rails 5 it is no longer possible to access session in controller tests: http://blog.napcs.com/2016/07/03/upgrading-rails-5-controller-tests/. The suggestion is to access the controller method that would set the appropriate session value for you. This comment shows and example of how you might work around this limitation: https://github.com/rails/rails/issues/23386#issuecomment-192954569
# helper method
def sign_in_as(name)
post login_url, params: { sig: users(name).perishable_signature )
end
class SomeControllerTest
setup { sign_in_as 'david' }
test 'the truth' do
..