mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Make controller/content_type_test.rb pass on new base
This commit is contained in:
parent
c8eda9ade4
commit
7f7fdc407a
2 changed files with 9 additions and 4 deletions
|
@ -58,11 +58,12 @@ end
|
||||||
desc 'Old Controller Tests on New Base'
|
desc 'Old Controller Tests on New Base'
|
||||||
Rake::TestTask.new(:test_new_base_on_old_tests) do |t|
|
Rake::TestTask.new(:test_new_base_on_old_tests) do |t|
|
||||||
t.libs << "test/new_base" << "test"
|
t.libs << "test/new_base" << "test"
|
||||||
# content_type layout
|
# layout
|
||||||
# Dir.glob( "test/{dispatch,template}/**/*_test.rb" ).sort +
|
# Dir.glob( "test/{dispatch,template}/**/*_test.rb" ).sort +
|
||||||
t.test_files = %w(
|
t.test_files = %w(
|
||||||
addresses_render base benchmark caching capture dispatcher flash mime_responds
|
addresses_render base benchmark caching capture content_type dispatcher
|
||||||
record_identifier redirect render rescue url_rewriter webservice
|
flash mime_responds record_identifier redirect render rescue url_rewriter
|
||||||
|
webservice
|
||||||
).map { |name| "test/controller/#{name}_test.rb" }
|
).map { |name| "test/controller/#{name}_test.rb" }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,11 @@ module ActionController
|
||||||
ret = super(options)
|
ret = super(options)
|
||||||
|
|
||||||
options[:_template] ||= _action_view._partial
|
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
|
ret
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue