The following test_helper method, given Devise as the authentication method,
def sign_in_with_section_id_as(user)
post user_session_url, params: { user_id: user.id, selected_section: 31 }
end
is not setting the context for a test where a session[:selected_section] value needs to be processed, using the technique suggested here. However, when run,
sign_in_with_section_id_as(roleshopuser.user)
puts session[:selected_section]
that context is returning nil for the session value.
How can this be achieved, possibly with the the ActionDispatch Integration methods relating to sessions ?