Rails 2.3.5
Upgrade to Rails 2.3.5. Also work around this bug: https://rails.lighthouseapp.com/projects/8994/tickets/3524 created by the aforementioned Rails release.
This commit is contained in:
parent
a6429f8c22
commit
e3832c6f79
187 changed files with 2316 additions and 891 deletions
|
@ -207,6 +207,24 @@ class IntegrationTestTest < Test::Unit::TestCase
|
|||
assert_equal ::ActionController::Integration::Session, session2.class
|
||||
assert_not_equal session1, session2
|
||||
end
|
||||
|
||||
# RSpec mixes Matchers (which has a #method_missing) into
|
||||
# IntegrationTest's superclass. Make sure IntegrationTest does not
|
||||
# try to delegate these methods to the session object.
|
||||
def test_does_not_prevent_method_missing_passing_up_to_ancestors
|
||||
mixin = Module.new do
|
||||
def method_missing(name, *args)
|
||||
name.to_s == 'foo' ? 'pass' : super
|
||||
end
|
||||
end
|
||||
@test.class.superclass.__send__(:include, mixin)
|
||||
begin
|
||||
assert_equal 'pass', @test.foo
|
||||
ensure
|
||||
# leave other tests as unaffected as possible
|
||||
mixin.__send__(:remove_method, :method_missing)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Tests that integration tests don't call Controller test methods for processing.
|
||||
|
@ -443,3 +461,23 @@ class MetalTest < ActionController::IntegrationTest
|
|||
assert_equal '', response.body
|
||||
end
|
||||
end
|
||||
|
||||
class StringSubclassBodyTest < ActionController::IntegrationTest
|
||||
class SafeString < String
|
||||
end
|
||||
|
||||
class SafeStringMiddleware
|
||||
def self.call(env)
|
||||
[200, {"Content-Type" => "text/plain", "Content-Length" => "12"}, [SafeString.new("Hello World!")]]
|
||||
end
|
||||
end
|
||||
|
||||
def setup
|
||||
@integration_session = ActionController::Integration::Session.new(SafeStringMiddleware)
|
||||
end
|
||||
|
||||
def test_string_subclass_body
|
||||
get '/'
|
||||
assert_equal 'Hello World!', response.body
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue