mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
307f93c6f1
To be used in one of two ways: post_it '/', :foo => 'bar', :env => { :agent => 'Mac Intel' } or post_it '/', '<myxml></myxml>', :agent => 'Mac Intel' to receive this in your EventContext For query params: post '/' do params.inspect end For XML/JSON/etc.. : post '/' do request.body.string end
16 lines
276 B
Ruby
16 lines
276 B
Ruby
require File.dirname(__FILE__) + '/helper'
|
|
|
|
context "RESTful tests" do
|
|
|
|
specify "should take xml" do
|
|
post '/foo.xml' do
|
|
request.body.string
|
|
end
|
|
|
|
post_it '/foo.xml', '<myxml></myxml>'
|
|
assert ok?
|
|
assert_equal('<myxml></myxml>', body)
|
|
end
|
|
|
|
end
|
|
|