mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-07 08:21:47 +01:00
Removed superfluous 'tracks' directory at the root of the repository.
Testing commits to github.
This commit is contained in:
parent
6a42901514
commit
4cbf5a34d3
2269 changed files with 0 additions and 0 deletions
41
vendor/rails/actionpack/test/controller/custom_handler_test.rb
vendored
Normal file
41
vendor/rails/actionpack/test/controller/custom_handler_test.rb
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
require File.dirname(__FILE__) + '/../abstract_unit'
|
||||
|
||||
class CustomHandler
|
||||
def initialize( view )
|
||||
@view = view
|
||||
end
|
||||
|
||||
def render( template, local_assigns )
|
||||
[ template,
|
||||
local_assigns,
|
||||
@view ]
|
||||
end
|
||||
end
|
||||
|
||||
class CustomHandlerTest < Test::Unit::TestCase
|
||||
def setup
|
||||
ActionView::Base.register_template_handler "foo", CustomHandler
|
||||
ActionView::Base.register_template_handler :foo2, CustomHandler
|
||||
@view = ActionView::Base.new
|
||||
end
|
||||
|
||||
def test_custom_render
|
||||
result = @view.render_template( "foo", "hello <%= one %>", nil, :one => "two" )
|
||||
assert_equal(
|
||||
[ "hello <%= one %>", { :one => "two" }, @view ],
|
||||
result )
|
||||
end
|
||||
|
||||
def test_custom_render2
|
||||
result = @view.render_template( "foo2", "hello <%= one %>", nil, :one => "two" )
|
||||
assert_equal(
|
||||
[ "hello <%= one %>", { :one => "two" }, @view ],
|
||||
result )
|
||||
end
|
||||
|
||||
def test_unhandled_extension
|
||||
# uses the ERb handler by default if the extension isn't recognized
|
||||
result = @view.render_template( "bar", "hello <%= one %>", nil, :one => "two" )
|
||||
assert_equal "hello two", result
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue