From 3edf1163d626529b15a9054c431c83b50811c04d Mon Sep 17 00:00:00 2001 From: MAEDA Go Date: Sun, 26 Jan 2020 22:48:47 +0900 Subject: [PATCH] Replace content_type with media_type --- .../functional/attachments_controller_test.rb | 40 +++++++++--------- .../auth_sources_controller_test.rb | 2 +- .../custom_fields_controller_test.rb | 2 +- test/functional/gantts_controller_test.rb | 6 +-- test/functional/groups_controller_test.rb | 6 +-- .../issue_categories_controller_test.rb | 6 +-- .../issue_relations_controller_test.rb | 6 +-- test/functional/issues_controller_test.rb | 42 +++++++++---------- test/functional/journals_controller_test.rb | 20 ++++----- test/functional/members_controller_test.rb | 10 ++--- test/functional/messages_controller_test.rb | 4 +- .../principal_memberships_controller_test.rb | 20 ++++----- test/functional/projects_controller_test.rb | 4 +- test/functional/queries_controller_test.rb | 18 ++++---- .../repositories_controller_test.rb | 10 ++--- ...repositories_filesystem_controller_test.rb | 4 +- ...repositories_subversion_controller_test.rb | 4 +- test/functional/sys_controller_test.rb | 4 +- test/functional/timelog_controller_test.rb | 2 +- test/functional/versions_controller_test.rb | 6 +-- test/functional/wiki_controller_test.rb | 14 +++---- test/integration/api_test/attachments_test.rb | 14 +++---- .../api_test/custom_fields_test.rb | 2 +- .../integration/api_test/enumerations_test.rb | 4 +- test/integration/api_test/groups_test.rb | 20 ++++----- .../api_test/issue_categories_test.rb | 10 ++--- .../api_test/issue_relations_test.rb | 6 +-- .../api_test/issue_statuses_test.rb | 2 +- test/integration/api_test/issues_test.rb | 22 +++++----- test/integration/api_test/memberships_test.rb | 12 +++--- test/integration/api_test/my_test.rb | 6 +-- test/integration/api_test/news_test.rb | 4 +- test/integration/api_test/projects_test.rb | 30 ++++++------- test/integration/api_test/queries_test.rb | 2 +- test/integration/api_test/roles_test.rb | 6 +-- test/integration/api_test/search_test.rb | 4 +- .../integration/api_test/time_entries_test.rb | 20 ++++----- test/integration/api_test/trackers_test.rb | 2 +- test/integration/api_test/users_test.rb | 16 +++---- test/integration/api_test/versions_test.rb | 12 +++--- test/integration/api_test/wiki_pages_test.rb | 12 +++--- test/integration/attachments_test.rb | 2 +- test/integration/welcome_test.rb | 2 +- test/test_helper.rb | 6 +-- 44 files changed, 223 insertions(+), 223 deletions(-) diff --git a/test/functional/attachments_controller_test.rb b/test/functional/attachments_controller_test.rb index b0cb09251..a3442f6a3 100644 --- a/test/functional/attachments_controller_test.rb +++ b/test/functional/attachments_controller_test.rb @@ -45,7 +45,7 @@ class AttachmentsControllerTest < Redmine::ControllerTest ) assert_response :success - assert_equal 'text/html', @response.content_type + assert_equal 'text/html', @response.media_type assert_select 'th.filename', :text => /issues_controller.rb\t\(révision 1484\)/ assert_select 'td.line-code', :text => /Demande créée avec succès/ end @@ -64,7 +64,7 @@ class AttachmentsControllerTest < Redmine::ControllerTest ) assert_response :success - assert_equal 'text/html', @response.content_type + assert_equal 'text/html', @response.media_type assert_select 'th.filename', :text => /issues_controller.rb\t\(r\?vision 1484\)/ assert_select 'td.line-code', :text => /Demande cr\?\?e avec succ\?s/ end @@ -84,7 +84,7 @@ class AttachmentsControllerTest < Redmine::ControllerTest ) assert_response :success - assert_equal 'text/html', @response.content_type + assert_equal 'text/html', @response.media_type assert_select 'th.filename', :text => /issues_controller.rb\t\(révision 1484\)/ assert_select 'td.line-code', :text => /Demande créée avec succès/ end @@ -136,14 +136,14 @@ class AttachmentsControllerTest < Redmine::ControllerTest } ) assert_response :success - assert_equal 'text/html', @response.content_type + assert_equal 'text/html', @response.media_type assert_select 'th.filename', :text => 'test1.txt' end def test_show_text_file get(:show, :params => {:id => 4}) assert_response :success - assert_equal 'text/html', @response.content_type + assert_equal 'text/html', @response.media_type end def test_show_text_file_utf_8 @@ -155,7 +155,7 @@ class AttachmentsControllerTest < Redmine::ControllerTest assert_equal 'japanese-utf-8.txt', a.filename get(:show, :params => {:id => a.id}) assert_response :success - assert_equal 'text/html', @response.content_type + assert_equal 'text/html', @response.media_type assert_select 'tr#L1' do assert_select 'th.line-num', :text => '1' assert_select 'td', :text => /日本語/ @@ -172,7 +172,7 @@ class AttachmentsControllerTest < Redmine::ControllerTest assert_equal 'iso8859-1.txt', a.filename get(:show, :params => {:id => a.id}) assert_response :success - assert_equal 'text/html', @response.content_type + assert_equal 'text/html', @response.media_type assert_select 'tr#L7' do assert_select 'th.line-num', :text => '7' assert_select 'td', :text => /Demande cr\?\?e avec succ\?s/ @@ -190,7 +190,7 @@ class AttachmentsControllerTest < Redmine::ControllerTest assert_equal 'iso8859-1.txt', a.filename get(:show, :params => {:id => a.id}) assert_response :success - assert_equal 'text/html', @response.content_type + assert_equal 'text/html', @response.media_type assert_select 'tr#L7' do assert_select 'th.line-num', :text => '7' assert_select 'td', :text => /Demande créée avec succès/ @@ -204,7 +204,7 @@ class AttachmentsControllerTest < Redmine::ControllerTest Attachment.find(4).update_attribute :filesize, 754.kilobyte get(:show, :params => {:id => 4}) assert_response :success - assert_equal 'text/html', @response.content_type + assert_equal 'text/html', @response.media_type assert_select '.nodata', :text => 'No preview available. Download the file instead.' end end @@ -218,7 +218,7 @@ class AttachmentsControllerTest < Redmine::ControllerTest assert_equal 'testfile.md', a.filename get(:show, :params => {:id => a.id}) assert_response :success - assert_equal 'text/html', @response.content_type + assert_equal 'text/html', @response.media_type assert_select 'div.wiki', :html => "

Header 1

\n\n

Header 2

\n\n

Header 3

" end @@ -231,7 +231,7 @@ class AttachmentsControllerTest < Redmine::ControllerTest assert_equal 'testfile.textile', a.filename get(:show, :params => {:id => a.id}) assert_response :success - assert_equal 'text/html', @response.content_type + assert_equal 'text/html', @response.media_type assert_select 'div.wiki', :html => "

Header 1

\n\n\n\t

Header 2

\n\n\n\t

Header 3

" end @@ -239,14 +239,14 @@ class AttachmentsControllerTest < Redmine::ControllerTest @request.session[:user_id] = 2 get(:show, :params => {:id => 16}) assert_response :success - assert_equal 'text/html', @response.content_type + assert_equal 'text/html', @response.media_type assert_select 'img.filecontent', :src => attachments(:attachments_010).filename end def test_show_other_with_no_preview @request.session[:user_id] = 2 get(:show, :params => {:id => 6}) - assert_equal 'text/html', @response.content_type + assert_equal 'text/html', @response.media_type assert_select '.nodata', :text => 'No preview available. Download the file instead.' end @@ -301,7 +301,7 @@ class AttachmentsControllerTest < Redmine::ControllerTest def test_download_text_file get(:download, :params => {:id => 4}) assert_response :success - assert_equal 'application/x-ruby', @response.content_type + assert_equal 'application/x-ruby', @response.media_type etag = @response.etag assert_not_nil etag @@ -320,7 +320,7 @@ class AttachmentsControllerTest < Redmine::ControllerTest get(:download, :params => {:id => attachment.id}) assert_response :success - assert_equal 'text/javascript', @response.content_type + assert_equal 'text/javascript', @response.media_type end def test_download_version_file_with_issue_tracking_disabled @@ -333,21 +333,21 @@ class AttachmentsControllerTest < Redmine::ControllerTest Attachment.find(4).update_attribute(:content_type, '') get(:download, :params => {:id => 4}) assert_response :success - assert_equal 'text/x-ruby', @response.content_type + assert_equal 'text/x-ruby', @response.media_type end def test_download_should_assign_better_content_type_than_application_octet_stream Attachment.find(4).update! :content_type => "application/octet-stream" get(:download, :params => {:id => 4}) assert_response :success - assert_equal 'text/x-ruby', @response.content_type + assert_equal 'text/x-ruby', @response.media_type end def test_download_should_assign_application_octet_stream_if_content_type_is_not_determined get(:download, :params => {:id => 22}) assert_response :success assert_nil Redmine::MimeType.of(attachments(:attachments_022).filename) - assert_equal 'application/octet-stream', @response.content_type + assert_equal 'application/octet-stream', @response.media_type end def test_download_missing_file @@ -371,7 +371,7 @@ class AttachmentsControllerTest < Redmine::ControllerTest } ) assert_response :success - assert_equal 'image/png', response.content_type + assert_equal 'image/png', response.media_type etag = @response.etag assert_not_nil etag @@ -459,7 +459,7 @@ class AttachmentsControllerTest < Redmine::ControllerTest } ) assert_response :success - assert_equal 'image/png', response.content_type + assert_equal 'image/png', response.media_type end else puts '(GhostScript convert not available)' diff --git a/test/functional/auth_sources_controller_test.rb b/test/functional/auth_sources_controller_test.rb index 6337640e7..f01f62f9d 100644 --- a/test/functional/auth_sources_controller_test.rb +++ b/test/functional/auth_sources_controller_test.rb @@ -197,7 +197,7 @@ class AuthSourcesControllerTest < Redmine::ControllerTest :term => 'foo' } assert_response :success - assert_equal 'application/json', response.content_type + assert_equal 'application/json', response.media_type json = ActiveSupport::JSON.decode(response.body) assert_kind_of Array, json assert_equal 2, json.size diff --git a/test/functional/custom_fields_controller_test.rb b/test/functional/custom_fields_controller_test.rb index 7f41888ff..07229d441 100644 --- a/test/functional/custom_fields_controller_test.rb +++ b/test/functional/custom_fields_controller_test.rb @@ -263,7 +263,7 @@ class CustomFieldsControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type assert_include '