Skip to content
This repository has been archived by the owner on Aug 17, 2017. It is now read-only.

test, not raise against NEVER_UNPERMITTED_PARAMS #229

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

levsero
Copy link

@levsero levsero commented Aug 12, 2015

Add a test checking that any param included in Parameters::NEVER_UNPERMITTED_PARAMS will not raise an error even if not explicitly permitted.

Add a test checking that any param included in Parameters::NEVER_UNPERMITTED_PARAMS will not raise an error even if not explicitly permitted.
})

assert_nothing_raised(ActionController::UnpermittedParameters) do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to pass the exception.

`Array.sample` not supported in ruby 1.8.7 (with Gemfile.rails-3.0x ) so switched to using `index[0]`
the comment wouldn't have stayed in sync with code changes.
@levsero levsero changed the title not raise against NEVER_UNPERMITTED_PARAMS test, not raise against NEVER_UNPERMITTED_PARAMS Aug 24, 2015
key = ActionController::Parameters::NEVER_UNPERMITTED_PARAMS[0]
params = ActionController::Parameters.new({
key => "Turnips"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to test each entries of the NEVER_UNPERMITTED_PARAMS array. isn't it?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants