You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 17, 2017. It is now read-only.
It seems that modifying the parameters on the request directly won't end up modifying the parameters in the controller since it's memoized.
This is an issue when you have an external class the modifies the request object and then uses the parameters in a subsequent action. As a simplified example:
I have a similar issue, params update correctly but don't propagate to tests:
# in controllerdefsome_actionparams[:some_attr]='foo'redirect_toparams[:some_attr]# works fineend# in testdeftest_some_actionget:some_actionassert_equal'foo',request.params[:some_attr]end
ok, so, modifying params works, passing request.params won't work in your case. For my tests, I was able to fix by doing @controller.params[:some_attr] in the test
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It seems that modifying the parameters on the request directly won't end up modifying the parameters in the controller since it's memoized.
This is an issue when you have an external class the modifies the request object and then uses the parameters in a subsequent action. As a simplified example:
Right now we're using a workaround to explicitly set the params to request.params after the action so the cache is updated, e.g.:
The text was updated successfully, but these errors were encountered: