aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/required_params_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Remove deprecated methods in ActionController::ParametersRafael Mendonça França2016-10-101-7/+1
|
* Do not allow to_param on AC::ParametersKir Shatrov2016-08-311-0/+6
|
* Add three new rubocop rulesRafael Mendonça França2016-08-161-2/+2
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* applies remaining conventions across the projectXavier Noria2016-08-061-1/+0
|
* remove redundant curlies from hash argumentsXavier Noria2016-08-061-1/+1
|
* applies new string literal convention in actionpack/testXavier Noria2016-08-061-4/+4
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Add methods to StrongParametersschneems2016-01-191-1/+8
| | | It's reasonable to expose different value readers.
* [close #23084] Deprecated StrongParametersschneems2016-01-191-0/+6
| | | | We can provide a more flexible upgrade experience by warning users they are using unsafe methods instead of forcing the safe API by deprecating before removal. This PR provides this functionality.
* revises 877e42eXavier Noria2015-08-281-6/+6
| | | | | | | | | | | | | | | | | | | | | | * A string in the example lacked quotes. * The tests asserted stuff about :last_name, whereas test params do not have that key. * But, the first one passed, why? After hitting my head against the wall and doing some obscure rituals realized the new #require had an important typo, wanted to iterate over the array argument (key), but it ran over its own hash keys (method #keys). * Modified the test to prevent the same typo to happen again. * The second test assigned to an unused variable safe_params that has been therefore removed. * Grammar of the second test description. * Since I was on it, reworded both test descriptions.
* [Feature] params.require requires array of paramsGaurish Sharma2015-08-281-0/+17
| | | | | | | | | | | | | | | | | This PR adds ability to accept arrays which allows you to require multiple values in one method. so instead of this: ```ruby params.require(:person).require(:first_name) params.require(:person).require(:last_name) ``` Here it will be one line for each params, so say if I require 10params, it will be 10lines of repeated code which is not dry. So I have added new method which does this in one line: ```ruby params.require(:person).require([:first_name, :last_name]) ``` Comments welcome
* Switch to kwargs in ActionController::TestCase and ActionDispatch::IntegrationKir Shatrov2015-01-291-4/+4
| | | | | | | | Non-kwargs requests are deprecated now. Guides are updated as well. `post url, nil, nil, { a: 'b' }` doesn't make sense. `post url, params: { y: x }, session: { a: 'b' }` would be an explicit way to do the same
* Merge pull request #15692 from sromano/falseClassMatthew Draper2014-06-141-1/+17
|\ | | | | | | ActionController::Parameters#require now accepts FalseClass values
| * ActionController::Parameters#require now accepts FalseClass valuesSergio Romano2014-06-131-1/+17
|/ | | | Fixes #15685.
* unify param.require testsArthur Neves2014-01-231-0/+8
|
* Revert "Merge pull request #9660 from ↵Guillermo Iguaran2013-11-021-19/+0
| | | | | | | | | sebasoga/change_strong_parameters_require_behaviour" This reverts commit c2b5a8e61ba0f35015e6ac949a5c8fce2042a1f2, reversing changes made to 1918b12c0429caec2a6134ac5e5b42ade103fe90. See: https://github.com/rails/rails/pull/9660#issuecomment-27627493
* Change ActionController::Parameters#require behavior when value is emptySebastian Sogamoso2013-03-111-0/+19
| | | | | When the value for the required key is empty an ActionController::ParameterMissing is raised which gets caught by ActionController::Base and turned into a 400 Bad Request reply with a message in the body saying the key is missing, which is misleading. With these changes, ActionController::EmptyParameter will be raised which ActionController::Base will catch and turn into a 400 Bad Request reply with a message in the body saying the key value is empty.
* Remove warnings: "(...) interpreted as grouped expression"Carlos Antonio da Silva2013-01-161-2/+2
|
* strong parameters exception handlingBrian Alexander2013-01-151-9/+6
|
* Integrate ActionController::Parameters from StrongParameters gemGuillermo Iguaran2012-09-161-0/+30