mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
52658061d1
Sinatra::Test#param_string was slurped from merb: <http://github.com/wycats/merb/blob/84f61f39/merb-core/lib/merb-core/dispatch/request_parsers.rb#L156>
21 lines
442 B
Ruby
21 lines
442 B
Ruby
require File.dirname(__FILE__) + '/helper'
|
|
|
|
describe "Sinatra::Test" do
|
|
it "support nested parameters" do
|
|
mock_app {
|
|
get '/' do
|
|
params[:post][:title]
|
|
end
|
|
|
|
post '/' do
|
|
params[:post][:content]
|
|
end
|
|
}
|
|
|
|
get '/', :post => { :title => 'My Post Title' }
|
|
assert_equal 'My Post Title', body
|
|
|
|
post '/', :post => { :content => 'Post Content' }
|
|
assert_equal 'Post Content', body
|
|
end
|
|
end
|