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
|
@ -3,6 +3,10 @@ require 'abstract_unit'
|
|||
# The view_paths array must be set on Base and not LayoutTest so that LayoutTest's inherited
|
||||
# method has access to the view_paths array when looking for a layout to automatically assign.
|
||||
old_load_paths = ActionController::Base.view_paths
|
||||
|
||||
ActionView::Template::register_template_handler :mab,
|
||||
lambda { |template| template.source.inspect }
|
||||
|
||||
ActionController::Base.view_paths = [ File.dirname(__FILE__) + '/../fixtures/layout_tests/' ]
|
||||
|
||||
class LayoutTest < ActionController::Base
|
||||
|
@ -31,14 +35,8 @@ end
|
|||
class MultipleExtensions < LayoutTest
|
||||
end
|
||||
|
||||
ActionView::Template::register_template_handler :mab,
|
||||
lambda { |template| template.source.inspect }
|
||||
|
||||
class LayoutAutoDiscoveryTest < Test::Unit::TestCase
|
||||
class LayoutAutoDiscoveryTest < ActionController::TestCase
|
||||
def setup
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
|
||||
@request.host = "www.nextangle.com"
|
||||
end
|
||||
|
||||
|
@ -55,10 +53,9 @@ class LayoutAutoDiscoveryTest < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_third_party_template_library_auto_discovers_layout
|
||||
ThirdPartyTemplateLibraryController.view_paths.reload!
|
||||
@controller = ThirdPartyTemplateLibraryController.new
|
||||
get :hello
|
||||
assert_equal 'layouts/third_party_template_library', @controller.active_layout
|
||||
assert_equal 'layouts/third_party_template_library.mab', @controller.active_layout.to_s
|
||||
assert_equal 'layouts/third_party_template_library', @response.layout
|
||||
assert_response :success
|
||||
assert_equal 'Mab', @response.body
|
||||
|
@ -67,14 +64,14 @@ class LayoutAutoDiscoveryTest < Test::Unit::TestCase
|
|||
def test_namespaced_controllers_auto_detect_layouts
|
||||
@controller = ControllerNameSpace::NestedController.new
|
||||
get :hello
|
||||
assert_equal 'layouts/controller_name_space/nested', @controller.active_layout
|
||||
assert_equal 'layouts/controller_name_space/nested', @controller.active_layout.to_s
|
||||
assert_equal 'controller_name_space/nested.rhtml hello.rhtml', @response.body
|
||||
end
|
||||
|
||||
def test_namespaced_controllers_auto_detect_layouts
|
||||
@controller = MultipleExtensions.new
|
||||
get :hello
|
||||
assert_equal 'layouts/multiple_extensions', @controller.active_layout
|
||||
assert_equal 'layouts/multiple_extensions.html.erb', @controller.active_layout.to_s
|
||||
assert_equal 'multiple_extensions.html.erb hello.rhtml', @response.body.strip
|
||||
end
|
||||
end
|
||||
|
@ -98,12 +95,7 @@ class RendersNoLayoutController < LayoutTest
|
|||
end
|
||||
end
|
||||
|
||||
class LayoutSetInResponseTest < Test::Unit::TestCase
|
||||
def setup
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
end
|
||||
|
||||
class LayoutSetInResponseTest < ActionController::TestCase
|
||||
def test_layout_set_when_using_default_layout
|
||||
@controller = DefaultLayoutController.new
|
||||
get :hello
|
||||
|
@ -150,17 +142,11 @@ class SetsNonExistentLayoutFile < LayoutTest
|
|||
layout "nofile.rhtml"
|
||||
end
|
||||
|
||||
class LayoutExceptionRaised < Test::Unit::TestCase
|
||||
def setup
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
end
|
||||
|
||||
class LayoutExceptionRaised < ActionController::TestCase
|
||||
def test_exception_raised_when_layout_file_not_found
|
||||
@controller = SetsNonExistentLayoutFile.new
|
||||
get :hello
|
||||
@response.template.class.module_eval { attr_accessor :exception }
|
||||
assert_equal ActionView::MissingTemplate, @response.template.exception.class
|
||||
assert_kind_of ActionView::MissingTemplate, @response.template.instance_eval { @exception }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -170,12 +156,7 @@ class LayoutStatusIsRendered < LayoutTest
|
|||
end
|
||||
end
|
||||
|
||||
class LayoutStatusIsRenderedTest < Test::Unit::TestCase
|
||||
def setup
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
end
|
||||
|
||||
class LayoutStatusIsRenderedTest < ActionController::TestCase
|
||||
def test_layout_status_is_rendered
|
||||
@controller = LayoutStatusIsRendered.new
|
||||
get :hello
|
||||
|
@ -183,20 +164,17 @@ class LayoutStatusIsRenderedTest < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class LayoutSymlinkedTest < LayoutTest
|
||||
layout "symlinked/symlinked_layout"
|
||||
end
|
||||
|
||||
class LayoutSymlinkedIsRenderedTest < Test::Unit::TestCase
|
||||
def setup
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
unless RUBY_PLATFORM =~ /(:?mswin|mingw|bccwin)/
|
||||
class LayoutSymlinkedTest < LayoutTest
|
||||
layout "symlinked/symlinked_layout"
|
||||
end
|
||||
|
||||
def test_symlinked_layout_is_rendered
|
||||
@controller = LayoutSymlinkedTest.new
|
||||
get :hello
|
||||
assert_response 200
|
||||
assert_equal "layouts/symlinked/symlinked_layout", @response.layout
|
||||
class LayoutSymlinkedIsRenderedTest < ActionController::TestCase
|
||||
def test_symlinked_layout_is_rendered
|
||||
@controller = LayoutSymlinkedTest.new
|
||||
get :hello
|
||||
assert_response 200
|
||||
assert_equal "layouts/symlinked/symlinked_layout", @response.layout
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue