This project is archived and is in readonly mode.

#2984 ✓ resolved
Adam Milligan

Warn when parameters to functional test requests have improper values

Reported by Adam Milligan | August 2nd, 2009 @ 07:52 AM | in 3.0.2

This is a replacement for the ticket here.

In that previous ticket I made the argument that functional tests shouldn't allow passing parameters with values that wouldn't come from an HTTP request; the patch I provided threw exceptions in such cases. This patch defaults to displaying a warning message for parameters with improper values. I also added support for modifying this behavior via class methods on ActionController::TestCase. Specifically, if you want exceptions then you can use ActionController::TestCase.treat_parameter_type_warnings_as_errors. If you choose to live your life in fear you can use ActionController::TestCase.ignore_parameter_type_warnings.

I removed changes I made in my previous patch to fix tests that were passing non-string values. Therefore, this patch causes a fair number of warning messages (the default) in the ActionPack test suite. I'll leave it up to general opinion whether to leave these warnings, silence them, or fix them.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Tickets have moved to Github

The new ticket tracker is available at https://github.com/rails/rails/issues

Shared Ticket Bins

Attachments

Referenced by

Pages