mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-26 20:08:51 +01:00
Upgraded to Rails 2.1. This can have wide ranging consequences, so please help track down any issues introduced by the upgrade. Requires environment.rb modifications.
Changes you will need to make: * In your environment.rb, you will need to update references to a few files per environment.rb.tmpl * In your environment.rb, you will need to specify the local time zone of the computer that is running your Tracks install. Other notes on my changes: * Modified our code to take advantage of Rails 2.1's slick time zone support. * Upgraded will_paginate for compatibility * Hacked the Selenium on Rails plugin, which has not been updated in some time and does not support Rails 2.1 * Verified that all tests pass on my machine, including Selenium tests -- I'd like confirmation from others, too.
This commit is contained in:
parent
f3bae73868
commit
901a58f8a3
1086 changed files with 51452 additions and 19526 deletions
|
|
@ -1,33 +1,36 @@
|
|||
require File.dirname(__FILE__) + '/../abstract_unit'
|
||||
require 'abstract_unit'
|
||||
|
||||
class CustomHandler
|
||||
class CustomHandler < ActionView::TemplateHandler
|
||||
def initialize( view )
|
||||
@view = view
|
||||
end
|
||||
|
||||
def render( template, local_assigns )
|
||||
[ template,
|
||||
local_assigns,
|
||||
def render( template )
|
||||
[ template.source,
|
||||
template.locals,
|
||||
@view ]
|
||||
end
|
||||
end
|
||||
|
||||
class CustomHandlerTest < Test::Unit::TestCase
|
||||
def setup
|
||||
ActionView::Base.register_template_handler "foo", CustomHandler
|
||||
ActionView::Base.register_template_handler :foo2, CustomHandler
|
||||
ActionView::Template.register_template_handler "foo", CustomHandler
|
||||
ActionView::Template.register_template_handler :foo2, CustomHandler
|
||||
@view = ActionView::Base.new
|
||||
end
|
||||
|
||||
def test_custom_render
|
||||
result = @view.render_template( "foo", "hello <%= one %>", nil, :one => "two" )
|
||||
template = ActionView::InlineTemplate.new(@view, "hello <%= one %>", { :one => "two" }, "foo")
|
||||
|
||||
result = @view.render_template(template)
|
||||
assert_equal(
|
||||
[ "hello <%= one %>", { :one => "two" }, @view ],
|
||||
result )
|
||||
end
|
||||
|
||||
def test_custom_render2
|
||||
result = @view.render_template( "foo2", "hello <%= one %>", nil, :one => "two" )
|
||||
template = ActionView::InlineTemplate.new(@view, "hello <%= one %>", { :one => "two" }, "foo2")
|
||||
result = @view.render_template(template)
|
||||
assert_equal(
|
||||
[ "hello <%= one %>", { :one => "two" }, @view ],
|
||||
result )
|
||||
|
|
@ -35,7 +38,8 @@ class CustomHandlerTest < Test::Unit::TestCase
|
|||
|
||||
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" )
|
||||
template = ActionView::InlineTemplate.new(@view, "hello <%= one %>", { :one => "two" }, "bar")
|
||||
result = @view.render_template(template)
|
||||
assert_equal "hello two", result
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue