Changeset 8899
- Timestamp:
- 02/19/08 21:43:13 (7 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/test/controller/integration_test.rb
r8564 r8899 4 4 uses_mocha 'integration' do 5 5 6 # Stub process for testing. 7 module ActionController 8 module Integration 9 class Session 10 def process(*args) 11 end 12 13 def generic_url_rewriter 14 end 15 end 6 module IntegrationSessionStubbing 7 def stub_integration_session(session) 8 session.stubs(:process) 9 session.stubs(:generic_url_rewriter) 16 10 end 17 11 end 18 12 19 13 class SessionTest < Test::Unit::TestCase 14 include IntegrationSessionStubbing 15 20 16 def setup 21 17 @session = ActionController::Integration::Session.new 22 end 18 stub_integration_session(@session) 19 end 20 23 21 def test_https_bang_works_and_sets_truth_by_default 24 22 assert !@session.https? … … 211 209 212 210 class IntegrationTestTest < Test::Unit::TestCase 211 include IntegrationSessionStubbing 213 212 214 213 def setup … … 216 215 @test.class.stubs(:fixture_table_names).returns([]) 217 216 @session = @test.open_session 217 stub_integration_session(@session) 218 218 end 219 219 … … 234 234 # Integration tests have their own setup and teardown. 235 235 class IntegrationTestUsesCorrectClass < ActionController::IntegrationTest 236 include IntegrationSessionStubbing 236 237 237 238 def self.fixture_table_names … … 240 241 241 242 def test_integration_methods_called 243 reset! 244 stub_integration_session(@integration_session) 242 245 %w( get post head put delete ).each do |verb| 243 246 assert_nothing_raised("'#{verb}' should use integration test methods") { send!(verb, '/') } … … 247 250 end 248 251 249 # TODO250 # class MockCGITest < Test::Unit::TestCase251 # end252 253 252 end # uses_mocha