1 require File.dirname(__FILE__) + '/helper'
8 Sinatra.setup_default_events!
10 Sinatra.config[:root] = File.dirname(__FILE__)
13 specify "sends files" do
18 body.should.equal '<foo></foo>'
19 headers.should.equal 'Content-Type' => 'application/xml',
20 'Content-Length' => '<foo></foo>'.size
24 specify "defaults to text/plain" do
29 body.should.equal 'bar'
30 headers.should.equal 'Content-Type' => 'text/plain',
31 'Content-Length' => 'bar'.size
34 specify "default to user definied type" do
35 Sinatra.config[:default_static_mime_type] = 'foo/bar'
40 body.should.equal 'bar'
41 headers.should.equal 'Content-Type' => 'foo/bar',
42 'Content-Length' => 'bar'.size
45 specify "handles files without ext" do
49 body.should.equal 'abc'
50 headers.should.equal 'Content-Type' => 'text/plain',
51 'Content-Length' => 'bar'.size
54 specify "should handle javascript correctly" do
59 body.should.equal 'var i = 11;'
60 headers.should.equal 'Content-Type' => 'text/javascript',
61 'Content-Length' => 'var i = 11;'.size