How to have integration test visit path+parameters: e.g.: url.com/users?parameters

163 Views Asked by At

I'm using the wice_grid gem for tables/grids. This gem offers sorting capability. If I for example sort on username by clicking that column's header, this converts in the browser to: www.url.com/users?grid[order]=username&grid[order_direction]=asc and it sorts the column on username in ascending order.

Now, I would like to test for sorting in an integration test. But how can I initiate a sorting in an integration test (as if the column's header is clicked)?

I have tried:

  • get users_path?grid[order]=fullname&grid[order_direction]=asc
  • get users_path(grid[order]=fullname,grid[order_direction]=asc)

But these don't seem to be the correct ways and generate errors.

A grid/column may for example look as follows in a view page:

<%= grid(@users_grid, show_filters: :when_filtered, html: {class: 'my-grid'}) do |g|
  g.column name: 'Username', attribute: 'username', auto_reload: true
end %>
0

There are 0 best solutions below