In a rails controller test, how does one send in a query string to the 'get' method? For example, for the url www.abc.com/categories?type=10.
In my test I would start with: get :index
but then how do I pass in the query string to it?
This should work in your controller test:
get :index, type: 10 In Rails 5 you do like:
path_params = {format: :json, project_id: "OSE"} get get_test_cases_url(**path_params), params: {case_ids: ["NON-9450", "NON-12345", "OCP-9361"]} get_test_cases is name of your route. The path_params are all params needed to construct URL for the route. And this is passing one array type query GET param.