How to stub parameters from a controller?

Viewed 6330

For my tests I need a controller where I can set my own parameters. With parameters I mean the one you get when invoking controller.params

{"action"=>"show",
 "controller"=>"merchants",
 "wine_id"=>"1",
 "id"=>"346343"}

The problem is, I don't know what the proper way for stubbing is here. There are three occurrences:

  • controller.request.env['action_dispatch.request.path_parameters']
  • controller.params
  • controller.url_options[:_recall]

In all three the same information is stored, but what's the interfaced way to set these values?

1 Answers
Related