Upgrade to Rails 2.0.2
Upgraded to Rails 2.0.2, except that we maintain vendor/rails/actionpack/lib/action_controller/routing.rb from Rail 1.2.6 (at least for now), so that Routes don't change. We still get to enjoy Rails's many new features. Also fixed a bug in Chunk-handling: disable WikiWord processing in tags (for real this time).
This commit is contained in:
parent
0f6889e09f
commit
6873fc8026
1083 changed files with 52810 additions and 41058 deletions
|
@ -1,5 +1,7 @@
|
|||
require File.dirname(__FILE__) + '/../abstract_unit'
|
||||
|
||||
ActionController::Helpers::HELPERS_DIR.replace File.dirname(__FILE__) + '/../fixtures/helpers'
|
||||
|
||||
class TestController < ActionController::Base
|
||||
attr_accessor :delegate_attr
|
||||
def delegate_method() end
|
||||
|
@ -15,7 +17,7 @@ module Fun
|
|||
def rescue_action(e) raise end
|
||||
end
|
||||
|
||||
class PDFController < ActionController::Base
|
||||
class PdfController < ActionController::Base
|
||||
def test
|
||||
render :inline => "test: <%= foobar %>"
|
||||
end
|
||||
|
@ -24,6 +26,10 @@ module Fun
|
|||
end
|
||||
end
|
||||
|
||||
class ApplicationController < ActionController::Base
|
||||
helper :all
|
||||
end
|
||||
|
||||
module LocalAbcHelper
|
||||
def a() end
|
||||
def b() end
|
||||
|
@ -120,16 +126,29 @@ class HelperTest < Test::Unit::TestCase
|
|||
response = ActionController::TestResponse.new
|
||||
request.action = 'test'
|
||||
|
||||
assert_equal 'test: baz', Fun::PDFController.process(request, response).body
|
||||
assert_equal 'test: baz', Fun::PdfController.process(request, response).body
|
||||
end
|
||||
|
||||
def test_all_helpers
|
||||
methods = ApplicationController.master_helper_module.instance_methods.map(&:to_s)
|
||||
|
||||
# abc_helper.rb
|
||||
assert methods.include?('bare_a')
|
||||
|
||||
# fun/games_helper.rb
|
||||
assert methods.include?('stratego')
|
||||
|
||||
# fun/pdf_helper.rb
|
||||
assert methods.include?('foobar')
|
||||
end
|
||||
|
||||
private
|
||||
def expected_helper_methods
|
||||
TestHelper.instance_methods
|
||||
TestHelper.instance_methods.map(&:to_s)
|
||||
end
|
||||
|
||||
def master_helper_methods
|
||||
@controller_class.master_helper_module.instance_methods
|
||||
@controller_class.master_helper_module.instance_methods.map(&:to_s)
|
||||
end
|
||||
|
||||
def missing_methods
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue