class IntegrationTestTest
Public Instance Methods
method_missing(name, *args)
click to toggle source
Calls superclass method
# File actionpack/test/controller/integration_test.rb, line 146 def method_missing(name, *args) name.to_s == "foo" ? "pass" : super end
setup()
click to toggle source
# File actionpack/test/controller/integration_test.rb, line 130 def setup @test = ::ActionDispatch::IntegrationTest.new(:app) end
test_does_not_prevent_method_missing_passing_up_to_ancestors()
click to toggle source
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.
# File actionpack/test/controller/integration_test.rb, line 144 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.include(mixin) begin assert_equal "pass", @test.foo ensure # leave other tests as unaffected as possible mixin.__send__(:remove_method, :method_missing) end end
test_opens_new_session()
click to toggle source
# File actionpack/test/controller/integration_test.rb, line 134 def test_opens_new_session session1 = @test.open_session { |sess| } session2 = @test.open_session # implicit session assert !session1.equal?(session2) end