Permalink
Browse files

Make controller/content_type_test.rb pass on new base

  • Loading branch information...
1 parent c8eda9a commit 7f7fdc407a90c9ce75ce0a77bc0f631115514d2f Yehuda Katz + Carl Lerche committed May 21, 2009
Showing with 9 additions and 4 deletions.
  1. +4 −3 actionpack/Rakefile
  2. +5 −1 actionpack/lib/action_controller/new_base/renderer.rb
View
@@ -58,11 +58,12 @@ end
desc 'Old Controller Tests on New Base'
Rake::TestTask.new(:test_new_base_on_old_tests) do |t|
t.libs << "test/new_base" << "test"
- # content_type layout
+ # layout
# Dir.glob( "test/{dispatch,template}/**/*_test.rb" ).sort +
t.test_files = %w(
- addresses_render base benchmark caching capture dispatcher flash mime_responds
- record_identifier redirect render rescue url_rewriter webservice
+ addresses_render base benchmark caching capture content_type dispatcher
+ flash mime_responds record_identifier redirect render rescue url_rewriter
+ webservice
).map { |name| "test/controller/#{name}_test.rb" }
end
@@ -38,7 +38,11 @@ def render_to_body(options)
ret = super(options)
options[:_template] ||= _action_view._partial
- response.content_type ||= options[:_template].mime_type
+ response.content_type ||= begin
+ mime = options[:_template].mime_type
+ mime &&= mime.to_sym
+ formats.include?(mime) ? mime : formats.first
+ end
ret
end

0 comments on commit 7f7fdc4

Please sign in to comment.