add specs for manipulating params in a before filter, fixes #367

This commit is contained in:
Konstantin Haase 2011-10-30 13:00:12 -07:00
parent 32814f8d6f
commit 1ef2e5f84d
1 changed files with 20 additions and 0 deletions

View File

@ -380,6 +380,26 @@ class AfterFilterTest < Test::Unit::TestCase
assert ran
end
it 'can add params' do
mock_app do
before { params['foo'] = 'bar' }
get('/') { params['foo'] }
end
get '/'
assert_body 'bar'
end
it 'can remove params' do
mock_app do
before { params.delete('foo') }
get('/') { params['foo'].to_s }
end
get '/?foo=bar'
assert_body ''
end
it 'is possible to apply user_agent conditions to after filters with no path' do
ran = false
mock_app do