Files
ubicloud/spec/routes/web/clover_web_spec.rb
Jeremy Evans c265a1ecf0 Prevent direct access to params in routes
All access must be done through typecast params.  When running
non-frozen tests, request.params is undefined before dispatching
to the route blocks, and any code calling it will result in a
NoMethodError.

To make debugging cases where r.params is used easier, don't
replace the NoMethodError with a RuntimeError if the NoMethodError
occurs before authorization is done and the SHOW_ERRORS
environment variable is used.

This moves the setting of @still_need_audit_logging and
@still_need_authorization to test-specific code, so those
variables are only set when running non-frozen tests.

Only remaining use of request.params is in redirect_back_with_inputs,
and we need to decide whether to adjust that to work with
typecast_params, or do proper error handling on failure and not
the redirect back to internal request approach.
2025-05-20 05:49:38 +09:00

3.8 KiB