test for parameter escaping

This commit is contained in:
Jacob Burkhart & Josh Lane 2011-09-22 15:35:44 -07:00
parent c59fad7eb0
commit 73c7f2de14
1 changed files with 11 additions and 0 deletions

View File

@ -97,6 +97,17 @@ class BeforeFilterTest < Test::Unit::TestCase
assert_equal 'cool', body
end
it "properly unescapes parameters" do
mock_app {
before { @foo = params['foo'] }
get('/foo') { @foo }
}
get '/foo?foo=bar%3Abaz%2Fbend'
assert ok?
assert_equal 'bar:baz/bend', body
end
it "runs filters defined in superclasses" do
base = Class.new(Sinatra::Base)
base.before { @foo = 'hello from superclass' }