~michaelforrest/use-case-mapper/trunk

« back to all changes in this revision

Viewing changes to vendor/rails/actionpack/test/controller/benchmark_test.rb

  • Committer: Richard Lee (Canonical)
  • Date: 2010-10-15 15:17:58 UTC
  • mfrom: (190.1.3 use-case-mapper)
  • Revision ID: richard.lee@canonical.com-20101015151758-wcvmfxrexsongf9d
Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
require 'abstract_unit'
2
 
 
3
 
# Provide some static controllers.
4
 
class BenchmarkedController < ActionController::Base
5
 
  def public_action
6
 
    render :nothing => true
7
 
  end
8
 
 
9
 
  def rescue_action(e)
10
 
    raise e
11
 
  end
12
 
end
13
 
 
14
 
class BenchmarkTest < ActionController::TestCase
15
 
  tests BenchmarkedController
16
 
 
17
 
  class MockLogger
18
 
    def method_missing(*args)
19
 
    end
20
 
  end
21
 
 
22
 
  def setup
23
 
    # benchmark doesn't do anything unless a logger is set
24
 
    @controller.logger = MockLogger.new
25
 
    @request.host = "test.actioncontroller.i"
26
 
  end
27
 
 
28
 
  def test_with_http_1_0_request
29
 
    @request.host = nil
30
 
    assert_nothing_raised { get :public_action }
31
 
  end
32
 
end