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:
Jacques Distler 2009-02-04 14:26:08 -06:00
parent 43aadecc99
commit 4e14ccc74d
893 changed files with 71965 additions and 28511 deletions

View file

@ -1,7 +1,7 @@
require 'abstract_unit'
require 'controller/fake_controllers'
class TestTest < Test::Unit::TestCase
class TestTest < ActionController::TestCase
class TestController < ActionController::Base
def no_op
render :text => 'dummy'
@ -23,8 +23,13 @@ class TestTest < Test::Unit::TestCase
render :text => 'Success'
end
def reset_the_session
reset_session
render :text => 'ignore me'
end
def render_raw_post
raise Test::Unit::AssertionFailedError, "#raw_post is blank" if request.raw_post.blank?
raise ActiveSupport::TestCase::Assertion, "#raw_post is blank" if request.raw_post.blank?
render :text => request.raw_post
end
@ -171,6 +176,24 @@ XML
assert_equal 'value2', session[:symbol]
end
def test_session_is_cleared_from_controller_after_reset_session
process :set_session
process :reset_the_session
assert_equal Hash.new, @controller.session.to_hash
end
def test_session_is_cleared_from_response_after_reset_session
process :set_session
process :reset_the_session
assert_equal Hash.new, @response.session.to_hash
end
def test_session_is_cleared_from_request_after_reset_session
process :set_session
process :reset_the_session
assert_equal Hash.new, @request.session.to_hash
end
def test_process_with_request_uri_with_no_params
process :test_uri
assert_equal "/test_test/test/test_uri", @response.body
@ -580,7 +603,7 @@ XML
assert_equal @response.redirect_url, redirect_to_url
# Must be a :redirect response.
assert_raise(Test::Unit::AssertionFailedError) do
assert_raise(ActiveSupport::TestCase::Assertion) do
assert_redirected_to 'created resource'
end
end
@ -602,9 +625,9 @@ XML
end
end
class CleanBacktraceTest < Test::Unit::TestCase
class CleanBacktraceTest < ActionController::TestCase
def test_should_reraise_the_same_object
exception = Test::Unit::AssertionFailedError.new('message')
exception = ActiveSupport::TestCase::Assertion.new('message')
clean_backtrace { raise exception }
rescue Exception => caught
assert_equal exception.object_id, caught.object_id
@ -613,7 +636,7 @@ class CleanBacktraceTest < Test::Unit::TestCase
def test_should_clean_assertion_lines_from_backtrace
path = File.expand_path("#{File.dirname(__FILE__)}/../../lib/action_controller")
exception = Test::Unit::AssertionFailedError.new('message')
exception = ActiveSupport::TestCase::Assertion.new('message')
exception.set_backtrace ["#{path}/abc", "#{path}/assertions/def"]
clean_backtrace { raise exception }
rescue Exception => caught
@ -629,21 +652,17 @@ class CleanBacktraceTest < Test::Unit::TestCase
end
end
class InferringClassNameTest < Test::Unit::TestCase
class InferringClassNameTest < ActionController::TestCase
def test_determine_controller_class
assert_equal ContentController, determine_class("ContentControllerTest")
end
def test_determine_controller_class_with_nonsense_name
assert_raises ActionController::NonInferrableControllerError do
determine_class("HelloGoodBye")
end
assert_nil determine_class("HelloGoodBye")
end
def test_determine_controller_class_with_sensible_name_where_no_controller_exists
assert_raises ActionController::NonInferrableControllerError do
determine_class("NoControllerWithThisNameTest")
end
assert_nil determine_class("NoControllerWithThisNameTest")
end
private