require_relative "test_helper"
class TestScrubParams < Minitest::Test
def test_scrub
params =
ActionController::Parameters.new({
"name" => "Hello ",
"tags" => ["awesome", "hack"],
"car" => {
"make" => ""
}
})
params.scrub!
expected = {
"name" => "Hello alert('World')",
"tags" => ["awesome", "hack"],
"car" => {
"make" => "Tesla"
}
}
assert_equal expected, params
end
end