Move {get,post}_via_redirect into conditional
Move {get,post}_via_redirect into conditional

Co-authored-by: Aubin Lorieux <509a521d3c53dd1329e16861d047ef3142312d79@gmail.com>

rails/rails-controller-testing,rails/rails-controller-testing