benchmark_test.rb 638 字节
Newer Older
1
require 'abstract_unit'
2

3 4 5 6 7
# Provide some static controllers.
class BenchmarkedController < ActionController::Base
  def public_action
    render :nothing => true
  end
8

9 10
  def rescue_action(e)
    raise e
11 12 13
  end
end

14 15 16
class BenchmarkTest < ActionController::TestCase
  tests BenchmarkedController

17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
  class MockLogger
    def method_missing(*args)
    end
  end

  def setup
    # benchmark doesn't do anything unless a logger is set
    @controller.logger = MockLogger.new
    @request.host = "test.actioncontroller.i"
  end

  def test_with_http_1_0_request
    @request.host = nil
    assert_nothing_raised { get :public_action }
  end
end