Rails - Rspec - stub params
If this is a controller spec, you should be able to do something like this:
allow(controller).to receive(:params).and_return({controller: 'a value'})
Alternatively, move the params[:controller]
statement to a separate method and stub that in your spec.
For strong parameters you can stub them as following:
params = ActionController::Parameters.new(foo: 'bar')
allow(controller).to receive(:params).and_return(params)