diff options
Diffstat (limited to 'railties/test/application/rack/logger_test.rb')
-rw-r--r-- | railties/test/application/rack/logger_test.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/railties/test/application/rack/logger_test.rb b/railties/test/application/rack/logger_test.rb index a29244357c..387eb25525 100644 --- a/railties/test/application/rack/logger_test.rb +++ b/railties/test/application/rack/logger_test.rb @@ -12,6 +12,12 @@ module ApplicationTests build_app require "#{app_path}/config/environment" super + @logger = MockLogger.new + Rails.stubs(:logger).returns(@logger) + end + + def teardown + teardown_app end def logs @@ -21,19 +27,19 @@ module ApplicationTests test "logger logs proper HTTP verb and path" do get "/blah" wait - assert_match /^Started GET "\/blah"/, logs[0] + assert_match(/^Started GET "\/blah"/, logs[0]) end test "logger logs HTTP verb override" do post "/", {:_method => 'put'} wait - assert_match /^Started PUT "\/"/, logs[0] + assert_match(/^Started PUT "\/"/, logs[0]) end test "logger logs HEAD requests" do post "/", {:_method => 'head'} wait - assert_match /^Started HEAD "\/"/, logs[0] + assert_match(/^Started HEAD "\/"/, logs[0]) end end end |