For controller tests you should use the get :index
call rather than the visit root_path
call. This will work for any valid combination of HTTP verbs and Rails actions you are controller testing.
The visit
method is part of Capybara and should be used in request specs only.