From c8eda9ade49700abce104de1ce7e8e1a754fc97e Mon Sep 17 00:00:00 2001 From: Yehuda Katz + Carl Lerche Date: Wed, 20 May 2009 17:22:29 -0700 Subject: Fixed new_base tests on ruby 1.9 --- actionpack/lib/action_controller/new_base/renderer.rb | 4 ++-- actionpack/lib/action_dispatch/http/mime_types.rb | 2 +- actionpack/test/lib/fixture_template.rb | 2 +- actionpack/test/new_base/etag_test.rb | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/actionpack/lib/action_controller/new_base/renderer.rb b/actionpack/lib/action_controller/new_base/renderer.rb index 276816a6f5..6176212970 100644 --- a/actionpack/lib/action_controller/new_base/renderer.rb +++ b/actionpack/lib/action_controller/new_base/renderer.rb @@ -4,8 +4,8 @@ module ActionController depends_on AbstractController::Renderer - def initialize(*) - self.formats = [:html] + def process_action(*) + self.formats = request.formats.map {|x| x.to_sym} super end diff --git a/actionpack/lib/action_dispatch/http/mime_types.rb b/actionpack/lib/action_dispatch/http/mime_types.rb index 2d7fba1173..7c28cac419 100644 --- a/actionpack/lib/action_dispatch/http/mime_types.rb +++ b/actionpack/lib/action_dispatch/http/mime_types.rb @@ -1,9 +1,9 @@ # Build list of Mime types for HTTP responses # http://www.iana.org/assignments/media-types/ +Mime::Type.register "text/html", :html, %w( application/xhtml+xml ), %w( xhtml ) Mime::Type.register "*/*", :all Mime::Type.register "text/plain", :text, [], %w(txt) -Mime::Type.register "text/html", :html, %w( application/xhtml+xml ), %w( xhtml ) Mime::Type.register "text/javascript", :js, %w( application/javascript application/x-javascript ) Mime::Type.register "text/css", :css Mime::Type.register "text/calendar", :ics diff --git a/actionpack/test/lib/fixture_template.rb b/actionpack/test/lib/fixture_template.rb index e43e329a9e..59fb6819ed 100644 --- a/actionpack/test/lib/fixture_template.rb +++ b/actionpack/test/lib/fixture_template.rb @@ -46,7 +46,7 @@ class Template end end - %r'#{Regexp.escape(path)}#{extensions}#{handler_regexp}' + %r'^#{Regexp.escape(path)}#{extensions}#{handler_regexp}$' end # TODO: fix me diff --git a/actionpack/test/new_base/etag_test.rb b/actionpack/test/new_base/etag_test.rb index c77636bb64..a40d3c936a 100644 --- a/actionpack/test/new_base/etag_test.rb +++ b/actionpack/test/new_base/etag_test.rb @@ -12,7 +12,7 @@ module Etags end def with_layout - render :action => "base", :layout => "etag" + render :action => "base", :layout => "etags" end end -- cgit v1.2.3