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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion test/raise_on_unpermitted_params_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,15 @@ def teardown
params.permit(:book => [:pages])
end
end
end

test "not raise on params included in NEVER_UNPERMITTED_PARAMS" do
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?

})

assert_nothing_raised do
params.permit
end
end
end