I am writing some specs for helpers that check for values in the params variable. Until now I have been doing:
helper.stub!(:params).and_return(:user => {:username => "jack"})
The problem is that while the actual params Hash has string/symbol-agnostic keys and params[:user] == params["user"], my implementation does not and produces various failures where it should not.
Is there a way to set the proper (key-type agnostic) params variable in helper specs?
THe easiest way to do this is to use
with_indifferent_access.In your case :