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?
Usual way of accessing params is by controller.params
. So i would advise you to stub params
controller.stub(:params).and_return({:param1 => "value", :param2 => "value"})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With