Instiki 0.16.3: Rails 2.3.0
Instiki now runs on the Rails 2.3.0 Candidate Release. Among other improvements, this means that it now automagically selects between WEBrick and Mongrel. Just run ./instiki --daemon
This commit is contained in:
parent
43aadecc99
commit
4e14ccc74d
893 changed files with 71965 additions and 28511 deletions
|
@ -19,7 +19,8 @@ class SendFileController < ActionController::Base
|
|||
def rescue_action(e) raise end
|
||||
end
|
||||
|
||||
class SendFileTest < Test::Unit::TestCase
|
||||
class SendFileTest < ActionController::TestCase
|
||||
tests SendFileController
|
||||
include TestFileUtils
|
||||
|
||||
Mime::Type.register "image/png", :png unless defined? Mime::PNG
|
||||
|
@ -69,6 +70,7 @@ class SendFileTest < Test::Unit::TestCase
|
|||
|
||||
assert_equal @controller.file_path, response.headers['X-Sendfile']
|
||||
assert response.body.blank?
|
||||
assert !response.etag?
|
||||
end
|
||||
|
||||
def test_data
|
||||
|
@ -118,17 +120,42 @@ class SendFileTest < Test::Unit::TestCase
|
|||
assert_equal 'private', h['Cache-Control']
|
||||
end
|
||||
|
||||
def test_send_file_headers_with_mime_lookup_with_symbol
|
||||
options = {
|
||||
:length => 1,
|
||||
:type => :png
|
||||
}
|
||||
|
||||
@controller.headers = {}
|
||||
@controller.send(:send_file_headers!, options)
|
||||
|
||||
headers = @controller.headers
|
||||
|
||||
assert_equal 'image/png', headers['Content-Type']
|
||||
end
|
||||
|
||||
|
||||
def test_send_file_headers_with_bad_symbol
|
||||
options = {
|
||||
:length => 1,
|
||||
:type => :this_type_is_not_registered
|
||||
}
|
||||
|
||||
@controller.headers = {}
|
||||
assert_raises(ArgumentError){ @controller.send(:send_file_headers!, options) }
|
||||
end
|
||||
|
||||
%w(file data).each do |method|
|
||||
define_method "test_send_#{method}_status" do
|
||||
@controller.options = { :stream => false, :status => 500 }
|
||||
assert_nothing_raised { assert_not_nil process(method) }
|
||||
assert_equal '500 Internal Server Error', @response.headers['Status']
|
||||
assert_equal '500 Internal Server Error', @response.status
|
||||
end
|
||||
|
||||
define_method "test_default_send_#{method}_status" do
|
||||
@controller.options = { :stream => false }
|
||||
assert_nothing_raised { assert_not_nil process(method) }
|
||||
assert_equal ActionController::Base::DEFAULT_RENDER_STATUS_CODE, @response.headers['Status']
|
||||
assert_equal ActionController::Base::DEFAULT_RENDER_STATUS_CODE, @response.status
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue