mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Ruby 1.9: resolve constant lookup issues
This commit is contained in:
parent
0ff8f81adc
commit
425a02cece
10 changed files with 19 additions and 19 deletions
|
@ -3,12 +3,6 @@ require 'active_support/core_ext/kernel/reporting'
|
|||
|
||||
ActionController::Base.helpers_dir = File.dirname(__FILE__) + '/../fixtures/helpers'
|
||||
|
||||
class TestController < ActionController::Base
|
||||
attr_accessor :delegate_attr
|
||||
def delegate_method() end
|
||||
def rescue_action(e) raise end
|
||||
end
|
||||
|
||||
module Fun
|
||||
class GamesController < ActionController::Base
|
||||
def render_hello_world
|
||||
|
@ -38,6 +32,12 @@ module LocalAbcHelper
|
|||
end
|
||||
|
||||
class HelperTest < Test::Unit::TestCase
|
||||
class TestController < ActionController::Base
|
||||
attr_accessor :delegate_attr
|
||||
def delegate_method() end
|
||||
def rescue_action(e) raise end
|
||||
end
|
||||
|
||||
def setup
|
||||
# Increment symbol counter.
|
||||
@symbol = (@@counter ||= 'A0').succ!.dup
|
||||
|
|
|
@ -860,7 +860,7 @@ class RenderTest < ActionController::TestCase
|
|||
# :ported:
|
||||
def test_access_to_controller_name_in_view
|
||||
get :accessing_controller_name_in_template
|
||||
assert_equal "test", @response.body # name is explicitly set to 'test' inside the controller.
|
||||
assert_equal "test", @response.body # name is explicitly set in the controller.
|
||||
end
|
||||
|
||||
# :ported:
|
||||
|
|
|
@ -343,9 +343,9 @@ class RescueTest < ActionController::IntegrationTest
|
|||
def with_test_routing
|
||||
with_routing do |set|
|
||||
set.draw do |map|
|
||||
match 'foo', :to => TestController.action(:foo)
|
||||
match 'invalid', :to => TestController.action(:invalid)
|
||||
match 'b00m', :to => TestController.action(:b00m)
|
||||
match 'foo', :to => ::RescueTest::TestController.action(:foo)
|
||||
match 'invalid', :to => ::RescueTest::TestController.action(:invalid)
|
||||
match 'b00m', :to => ::RescueTest::TestController.action(:b00m)
|
||||
end
|
||||
yield
|
||||
end
|
||||
|
|
|
@ -126,7 +126,7 @@ class VerificationTest < ActionController::TestCase
|
|||
with_routing do |set|
|
||||
set.draw do |map|
|
||||
match 'foo', :to => 'test#foo', :as => :foo
|
||||
match 'verification_test/:action', :to => TestController
|
||||
match 'verification_test/:action', :to => ::VerificationTest::TestController
|
||||
end
|
||||
get :guarded_one_for_named_route_test, :two => "not one"
|
||||
assert_redirected_to '/foo'
|
||||
|
|
|
@ -57,7 +57,7 @@ class JsonParamsParsingTest < ActionController::IntegrationTest
|
|||
def with_test_routing
|
||||
with_routing do |set|
|
||||
set.draw do |map|
|
||||
match ':action', :to => TestController
|
||||
match ':action', :to => ::JsonParamsParsingTest::TestController
|
||||
end
|
||||
yield
|
||||
end
|
||||
|
|
|
@ -109,12 +109,12 @@ class QueryStringParsingTest < ActionController::IntegrationTest
|
|||
def assert_parses(expected, actual)
|
||||
with_routing do |set|
|
||||
set.draw do |map|
|
||||
match ':action', :to => TestController
|
||||
match ':action', :to => ::QueryStringParsingTest::TestController
|
||||
end
|
||||
|
||||
get "/parse", actual
|
||||
assert_response :ok
|
||||
assert_equal(expected, TestController.last_query_parameters)
|
||||
assert_equal(expected, ::QueryStringParsingTest::TestController.last_query_parameters)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -130,7 +130,7 @@ class UrlEncodedParamsParsingTest < ActionController::IntegrationTest
|
|||
def with_test_routing
|
||||
with_routing do |set|
|
||||
set.draw do |map|
|
||||
match ':action', :to => TestController
|
||||
match ':action', :to => ::UrlEncodedParamsParsingTest::TestController
|
||||
end
|
||||
yield
|
||||
end
|
||||
|
|
|
@ -84,7 +84,7 @@ class XmlParamsParsingTest < ActionController::IntegrationTest
|
|||
def with_test_routing
|
||||
with_routing do |set|
|
||||
set.draw do |map|
|
||||
match ':action', :to => TestController
|
||||
match ':action', :to => ::XmlParamsParsingTest::TestController
|
||||
end
|
||||
yield
|
||||
end
|
||||
|
@ -100,4 +100,4 @@ class LegacyXmlParamsParsingTest < XmlParamsParsingTest
|
|||
def default_headers
|
||||
{'HTTP_X_POST_DATA_FORMAT' => 'xml'}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -219,7 +219,7 @@ class CookieStoreTest < ActionController::IntegrationTest
|
|||
def with_test_route_set(options = {})
|
||||
with_routing do |set|
|
||||
set.draw do |map|
|
||||
match ':action', :to => TestController
|
||||
match ':action', :to => ::CookieStoreTest::TestController
|
||||
end
|
||||
options = {:key => SessionKey, :secret => SessionSecret}.merge(options)
|
||||
@app = ActionDispatch::Session::CookieStore.new(set, options)
|
||||
|
|
|
@ -112,7 +112,7 @@ class MemCacheStoreTest < ActionController::IntegrationTest
|
|||
def with_test_route_set
|
||||
with_routing do |set|
|
||||
set.draw do |map|
|
||||
match ':action', :to => TestController
|
||||
match ':action', :to => ::MemCacheStoreTest::TestController
|
||||
end
|
||||
@app = ActionDispatch::Session::MemCacheStore.new(set, :key => '_session_id')
|
||||
yield
|
||||
|
|
Loading…
Reference in a new issue