diff options
Diffstat (limited to 'actionpack/test/controller/integration_test.rb')
-rw-r--r-- | actionpack/test/controller/integration_test.rb | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb index a26b6eb259..3bea949867 100644 --- a/actionpack/test/controller/integration_test.rb +++ b/actionpack/test/controller/integration_test.rb @@ -9,7 +9,7 @@ uses_mocha 'integration' do module ActionController module Integration class Session - def process + def process(*args) end def generic_url_rewriter @@ -143,6 +143,43 @@ class SessionTest < Test::Unit::TestCase end end +class IntegrationTestTest < Test::Unit::TestCase + + def setup + @test = ::ActionController::IntegrationTest.new(:default_test) + @test.class.stubs(:fixture_table_names).returns([]) + @session = @test.open_session + end + + def test_opens_new_session + @test.class.expects(:fixture_table_names).times(2).returns(['foo']) + + session1 = @test.open_session { |sess| } + session2 = @test.open_session # implicit session + + assert_equal ::ActionController::Integration::Session, session1.class + assert_equal ::ActionController::Integration::Session, session2.class + assert_not_equal session1, session2 + end + +end + +# Tests that integration tests don't call Controller test methods for processing. +# Integration tests have their own setup and teardown. +class IntegrationTestUsesCorrectClass < ActionController::IntegrationTest + + def self.fixture_table_names + [] + end + + def test_integration_methods_called + %w( get post head put delete ).each do |verb| + assert_nothing_raised("'#{verb}' should use integration test methods") { send(verb, '/') } + end + end + +end + # TODO # class MockCGITest < Test::Unit::TestCase # end |