diff options
author | Go MAEDA <maeda@farend.jp> | 2020-01-27 03:54:25 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2020-01-27 03:54:25 +0000 |
commit | f37ed7766572550bd563632f69ad940717fa9b90 (patch) | |
tree | 6ca7069360504e61396f2c95d458853ff4c8fa39 /test/functional | |
parent | d168df5c822f305cb510d072144c39f205b1bd3d (diff) | |
download | redmine-f37ed7766572550bd563632f69ad940717fa9b90.tar.gz redmine-f37ed7766572550bd563632f69ad940717fa9b90.zip |
Use #media_type instead of #content_type to test the MIME type of a response (#32886).
Patch by Go MAEDA.
git-svn-id: http://svn.redmine.org/redmine/trunk@19467 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
21 files changed, 115 insertions, 115 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 => "<h1>Header 1</h1>\n\n<h2>Header 2</h2>\n\n<h3>Header 3</h3>" 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 => "<h1>Header 1</h1>\n\n\n\t<h2>Header 2</h2>\n\n\n\t<h3>Header 3</h3>" 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 '<option selected=\"selected\" value=\"list\">List<\/option>', response.body end diff --git a/test/functional/gantts_controller_test.rb b/test/functional/gantts_controller_test.rb index 2042ecf88..606d5765e 100644 --- a/test/functional/gantts_controller_test.rb +++ b/test/functional/gantts_controller_test.rb @@ -142,7 +142,7 @@ class GanttsControllerTest < Redmine::ControllerTest :format => 'pdf' } assert_response :success - assert_equal 'application/pdf', @response.content_type + assert_equal 'application/pdf', @response.media_type assert @response.body.starts_with?('%PDF') end @@ -151,7 +151,7 @@ class GanttsControllerTest < Redmine::ControllerTest :format => 'pdf' } assert_response :success - assert_equal 'application/pdf', @response.content_type + assert_equal 'application/pdf', @response.media_type assert @response.body.starts_with?('%PDF') end @@ -162,7 +162,7 @@ class GanttsControllerTest < Redmine::ControllerTest :format => 'png' } assert_response :success - assert_equal 'image/png', @response.content_type + assert_equal 'image/png', @response.media_type end end diff --git a/test/functional/groups_controller_test.rb b/test/functional/groups_controller_test.rb index 091a31b5c..7f5033aa1 100644 --- a/test/functional/groups_controller_test.rb +++ b/test/functional/groups_controller_test.rb @@ -191,7 +191,7 @@ class GroupsControllerTest < Redmine::ControllerTest :xhr => true ) assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end def test_add_users @@ -217,7 +217,7 @@ class GroupsControllerTest < Redmine::ControllerTest :xhr => true ) assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end assert_match /John Smith/, response.body end @@ -245,7 +245,7 @@ class GroupsControllerTest < Redmine::ControllerTest :xhr => true ) assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end end diff --git a/test/functional/issue_categories_controller_test.rb b/test/functional/issue_categories_controller_test.rb index 478241608..d947f1557 100644 --- a/test/functional/issue_categories_controller_test.rb +++ b/test/functional/issue_categories_controller_test.rb @@ -45,7 +45,7 @@ class IssueCategoriesControllerTest < Redmine::ControllerTest :xhr => true ) assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end def test_create @@ -100,7 +100,7 @@ class IssueCategoriesControllerTest < Redmine::ControllerTest assert_equal 'New category', category.name assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end def test_create_from_issue_form_with_failure @@ -119,7 +119,7 @@ class IssueCategoriesControllerTest < Redmine::ControllerTest end assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type assert_include 'Name cannot be blank', response.body end diff --git a/test/functional/issue_relations_controller_test.rb b/test/functional/issue_relations_controller_test.rb index 45e87cbc1..f0395c9b8 100644 --- a/test/functional/issue_relations_controller_test.rb +++ b/test/functional/issue_relations_controller_test.rb @@ -81,7 +81,7 @@ class IssueRelationsControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end relation = IssueRelation.order('id DESC').first assert_equal 1, relation.issue_from_id @@ -182,7 +182,7 @@ class IssueRelationsControllerTest < Redmine::ControllerTest :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end assert_include 'Related issue cannot be blank', response.body end @@ -217,7 +217,7 @@ class IssueRelationsControllerTest < Redmine::ControllerTest :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type assert_include 'relation-2', response.body end end diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 9c793fdeb..11d93cf21 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -463,7 +463,7 @@ class IssuesControllerTest < Redmine::ControllerTest } ) assert_response :success - assert_equal 'application/pdf', response.content_type + assert_equal 'application/pdf', response.media_type end def test_index_with_query_grouped_by_list_custom_field @@ -1081,7 +1081,7 @@ class IssuesControllerTest < Redmine::ControllerTest get(:index, :params => {:format => 'pdf'}) assert_response :success - assert_equal 'application/pdf', @response.content_type + assert_equal 'application/pdf', @response.media_type get( :index, @@ -1091,7 +1091,7 @@ class IssuesControllerTest < Redmine::ControllerTest } ) assert_response :success - assert_equal 'application/pdf', @response.content_type + assert_equal 'application/pdf', @response.media_type get( :index, @@ -1102,7 +1102,7 @@ class IssuesControllerTest < Redmine::ControllerTest } ) assert_response :success - assert_equal 'application/pdf', @response.content_type + assert_equal 'application/pdf', @response.media_type end end end @@ -1117,7 +1117,7 @@ class IssuesControllerTest < Redmine::ControllerTest } ) assert_response :success - assert_equal 'application/pdf', @response.content_type + assert_equal 'application/pdf', @response.media_type end def test_index_atom @@ -1129,7 +1129,7 @@ class IssuesControllerTest < Redmine::ControllerTest } ) assert_response :success - assert_equal 'application/atom+xml', response.content_type + assert_equal 'application/atom+xml', response.media_type assert_select 'feed' do assert_select 'link[rel=self][href=?]', 'http://test.host/projects/ecookbook/issues.atom' @@ -1612,7 +1612,7 @@ class IssuesControllerTest < Redmine::ControllerTest } ) assert_response :success - assert_equal 'application/pdf', response.content_type + assert_equal 'application/pdf', response.media_type end def test_index_with_description_column @@ -1635,7 +1635,7 @@ class IssuesControllerTest < Redmine::ControllerTest } ) assert_response :success - assert_equal 'application/pdf', response.content_type + assert_equal 'application/pdf', response.media_type end def test_index_with_last_notes_column @@ -1663,7 +1663,7 @@ class IssuesControllerTest < Redmine::ControllerTest } ) assert_response :success - assert_equal 'application/pdf', response.content_type + assert_equal 'application/pdf', response.media_type end def test_index_with_last_notes_column_should_display_private_notes_with_permission_only @@ -1887,7 +1887,7 @@ class IssuesControllerTest < Redmine::ControllerTest } } ) - assert_equal 'text/html', @response.content_type + assert_equal 'text/html', @response.media_type assert_select_error /Start date cannot be blank/i end @@ -1902,7 +1902,7 @@ class IssuesControllerTest < Redmine::ControllerTest :format => 'csv' } ) - assert_equal 'text/csv', @response.content_type + assert_equal 'text/csv', @response.media_type assert @response.body.blank? end @@ -2649,7 +2649,7 @@ class IssuesControllerTest < Redmine::ControllerTest } ) assert_response :success - assert_equal 'application/atom+xml', response.content_type + assert_equal 'application/atom+xml', response.media_type # Inline image assert_select( 'content', @@ -2668,7 +2668,7 @@ class IssuesControllerTest < Redmine::ControllerTest } ) assert_response :success - assert_equal 'application/pdf', @response.content_type + assert_equal 'application/pdf', @response.media_type assert @response.body.starts_with?('%PDF') end @@ -2684,7 +2684,7 @@ class IssuesControllerTest < Redmine::ControllerTest } ) assert_response :success - assert_equal 'application/pdf', @response.content_type + assert_equal 'application/pdf', @response.media_type assert @response.body.starts_with?('%PDF') end end @@ -2702,7 +2702,7 @@ class IssuesControllerTest < Redmine::ControllerTest } ) assert_response :success - assert_equal 'application/pdf', @response.content_type + assert_equal 'application/pdf', @response.media_type assert @response.body.starts_with?('%PDF') end @@ -2721,7 +2721,7 @@ class IssuesControllerTest < Redmine::ControllerTest } ) assert_response :success - assert_equal 'application/pdf', @response.content_type + assert_equal 'application/pdf', @response.media_type assert @response.body.starts_with?('%PDF') end @@ -2734,7 +2734,7 @@ class IssuesControllerTest < Redmine::ControllerTest } ) assert_response :success - assert_equal 'application/pdf', @response.content_type + assert_equal 'application/pdf', @response.media_type assert @response.body.starts_with?('%PDF') end @@ -2754,7 +2754,7 @@ class IssuesControllerTest < Redmine::ControllerTest } ) assert_response :success - assert_equal 'application/pdf', @response.content_type + assert_equal 'application/pdf', @response.media_type assert @response.body.starts_with?('%PDF') end @@ -2773,7 +2773,7 @@ class IssuesControllerTest < Redmine::ControllerTest } ) assert_response :success - assert_equal 'application/pdf', @response.content_type + assert_equal 'application/pdf', @response.media_type assert @response.body.starts_with?('%PDF') end end @@ -3526,7 +3526,7 @@ class IssuesControllerTest < Redmine::ControllerTest :xhr => true ) assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type assert_include 'This is the test_new issue', response.body end @@ -5343,7 +5343,7 @@ class IssuesControllerTest < Redmine::ControllerTest :xhr => true ) assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type assert_include 'This is the test_new issue', response.body end diff --git a/test/functional/journals_controller_test.rb b/test/functional/journals_controller_test.rb index 929c2a1d0..6938e8c0e 100644 --- a/test/functional/journals_controller_test.rb +++ b/test/functional/journals_controller_test.rb @@ -34,7 +34,7 @@ class JournalsControllerTest < Redmine::ControllerTest :project_id => 1 } assert_response :success - assert_equal 'application/atom+xml', @response.content_type + assert_equal 'application/atom+xml', @response.media_type end def test_index_with_invalid_query_id @@ -166,7 +166,7 @@ class JournalsControllerTest < Redmine::ControllerTest :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type assert_include '> This is an issue', response.body end @@ -188,7 +188,7 @@ class JournalsControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type assert_include 'Redmine Admin wrote in #note-1:', response.body assert_include '> A comment with a private version', response.body end @@ -203,7 +203,7 @@ class JournalsControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type assert_include '> Privates notes', response.body Role.find(1).remove_permission! :view_private_notes @@ -222,7 +222,7 @@ class JournalsControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type assert_include 'textarea', response.body end @@ -236,7 +236,7 @@ class JournalsControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type assert_include 'textarea', response.body Role.find(1).remove_permission! :view_private_notes @@ -257,7 +257,7 @@ class JournalsControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type assert_equal 'Updated notes', Journal.find(2).notes assert_include 'journal-2-notes', response.body # response should include journal_indice param for quote link @@ -274,7 +274,7 @@ class JournalsControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type assert_equal true, Journal.find(2).private_notes assert_include 'change-2', response.body assert_include 'journal-2-private_notes', response.body @@ -291,7 +291,7 @@ class JournalsControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type assert_equal false, Journal.find(2).private_notes assert_include 'change-2', response.body assert_include 'journal-2-private_notes', response.body @@ -325,7 +325,7 @@ class JournalsControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end assert_nil Journal.find_by_id(2) assert_include 'change-2', response.body diff --git a/test/functional/members_controller_test.rb b/test/functional/members_controller_test.rb index 9bd7dc605..4d53bedcd 100644 --- a/test/functional/members_controller_test.rb +++ b/test/functional/members_controller_test.rb @@ -56,7 +56,7 @@ class MembersControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end def test_create @@ -133,7 +133,7 @@ class MembersControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end assert User.find(7).member_of?(Project.find(1)) assert User.find(8).member_of?(Project.find(1)) @@ -152,7 +152,7 @@ class MembersControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end assert_match /alert/, response.body, "Alert message not sent" end @@ -242,7 +242,7 @@ class MembersControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end member = Member.find(2) assert_equal [1], member.role_ids @@ -303,7 +303,7 @@ class MembersControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end assert_nil Member.find_by_id(2) assert_include 'tab-content-members', response.body diff --git a/test/functional/messages_controller_test.rb b/test/functional/messages_controller_test.rb index ad193b119..46e2c6c61 100644 --- a/test/functional/messages_controller_test.rb +++ b/test/functional/messages_controller_test.rb @@ -266,7 +266,7 @@ class MessagesControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type assert_include 'RE: First post', response.body assert_include "Redmine Admin wrote:", response.body @@ -281,7 +281,7 @@ class MessagesControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type assert_include 'RE: First post', response.body assert_include 'John Smith wrote in message#3:', response.body diff --git a/test/functional/principal_memberships_controller_test.rb b/test/functional/principal_memberships_controller_test.rb index 974abc1c4..5dc795867 100644 --- a/test/functional/principal_memberships_controller_test.rb +++ b/test/functional/principal_memberships_controller_test.rb @@ -54,7 +54,7 @@ class PrincipalMembershipsControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end def test_create_user_membership @@ -121,7 +121,7 @@ class PrincipalMembershipsControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end member = Member.order('id DESC').first assert_equal User.find(7), member.principal @@ -141,7 +141,7 @@ class PrincipalMembershipsControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end assert_include 'alert', response.body, "Alert message not sent" assert_include 'Role cannot be empty', response.body, "Error message not sent" @@ -191,7 +191,7 @@ class PrincipalMembershipsControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end assert_equal [2], Member.find(1).role_ids assert_include '$("#member-1-roles").html("Developer").show();', response.body @@ -216,7 +216,7 @@ class PrincipalMembershipsControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end assert_nil Member.find_by_id(1) assert_include 'tab-content-memberships', response.body @@ -228,7 +228,7 @@ class PrincipalMembershipsControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end def test_create_group_membership @@ -254,7 +254,7 @@ class PrincipalMembershipsControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end assert_match /OnlineStore/, response.body end @@ -270,7 +270,7 @@ class PrincipalMembershipsControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end assert_match /alert/, response.body, "Alert message not sent" end @@ -298,7 +298,7 @@ class PrincipalMembershipsControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end end @@ -319,7 +319,7 @@ class PrincipalMembershipsControllerTest < Redmine::ControllerTest }, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end end end diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index 89bfacee6..786bcebba 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -240,7 +240,7 @@ class ProjectsControllerTest < Redmine::ControllerTest :xhr => true ) assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end def test_autocomplete_js_with_blank_search_term @@ -253,7 +253,7 @@ class ProjectsControllerTest < Redmine::ControllerTest :xhr => true ) assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end test "#index by non-admin user with view_time_entries permission should show overall spent time link" do diff --git a/test/functional/queries_controller_test.rb b/test/functional/queries_controller_test.rb index 2db4ac7d6..39e4a20b7 100644 --- a/test/functional/queries_controller_test.rb +++ b/test/functional/queries_controller_test.rb @@ -706,7 +706,7 @@ class QueriesControllerTest < Redmine::ControllerTest } assert_response :success - assert_equal 'application/json', response.content_type + assert_equal 'application/json', response.media_type json = ActiveSupport::JSON.decode(response.body) assert_include ["eCookbook - 2.0", "3", "open"], json end @@ -720,7 +720,7 @@ class QueriesControllerTest < Redmine::ControllerTest } assert_response :success - assert_equal 'application/json', response.content_type + assert_equal 'application/json', response.media_type json = ActiveSupport::JSON.decode(response.body) assert_include ["eCookbook - 2.0", "3", "open"], json end @@ -735,7 +735,7 @@ class QueriesControllerTest < Redmine::ControllerTest } assert_response :success - assert_equal 'application/json', response.content_type + assert_equal 'application/json', response.media_type json = ActiveSupport::JSON.decode(response.body) # response includes visible version @@ -756,7 +756,7 @@ class QueriesControllerTest < Redmine::ControllerTest } assert_response :success - assert_equal 'application/json', response.content_type + assert_equal 'application/json', response.media_type json = ActiveSupport::JSON.decode(response.body) assert_equal 4, json.count assert_include ["Private child of eCookbook","5"], json @@ -770,7 +770,7 @@ class QueriesControllerTest < Redmine::ControllerTest :name => 'assigned_to_id' } assert_response :success - assert_equal 'application/json', response.content_type + assert_equal 'application/json', response.media_type json = ActiveSupport::JSON.decode(response.body) assert_equal 6, json.count @@ -788,7 +788,7 @@ class QueriesControllerTest < Redmine::ControllerTest :name => 'author_id' } assert_response :success - assert_equal 'application/json', response.content_type + assert_equal 'application/json', response.media_type json = ActiveSupport::JSON.decode(response.body) assert_equal 7, json.count @@ -807,7 +807,7 @@ class QueriesControllerTest < Redmine::ControllerTest :name => 'user_id' } assert_response :success - assert_equal 'application/json', response.content_type + assert_equal 'application/json', response.media_type json = ActiveSupport::JSON.decode(response.body) assert_equal 7, json.count @@ -827,7 +827,7 @@ class QueriesControllerTest < Redmine::ControllerTest :name => 'watcher_id' } assert_response :success - assert_equal 'application/json', response.content_type + assert_equal 'application/json', response.media_type json = ActiveSupport::JSON.decode(response.body) assert_equal 1, json.count @@ -844,7 +844,7 @@ class QueriesControllerTest < Redmine::ControllerTest :name => 'watcher_id' } assert_response :success - assert_equal 'application/json', response.content_type + assert_equal 'application/json', response.media_type json = ActiveSupport::JSON.decode(response.body) assert_equal 6, json.count diff --git a/test/functional/repositories_controller_test.rb b/test/functional/repositories_controller_test.rb index 846eb84e0..cca1d99a4 100644 --- a/test/functional/repositories_controller_test.rb +++ b/test/functional/repositories_controller_test.rb @@ -331,7 +331,7 @@ class RepositoriesControllerTest < Redmine::RepositoryControllerTest :xhr => true ) assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end assert_equal [2], Changeset.find(103).issue_ids assert_include 'related-issues', response.body @@ -371,7 +371,7 @@ class RepositoriesControllerTest < Redmine::RepositoryControllerTest :xhr => true ) assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end assert_include 'alert("Issue is invalid")', response.body end @@ -393,7 +393,7 @@ class RepositoriesControllerTest < Redmine::RepositoryControllerTest :xhr => true ) assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end assert_equal [1], Changeset.find(103).issue_ids assert_include 'related-issue-2', response.body @@ -413,7 +413,7 @@ class RepositoriesControllerTest < Redmine::RepositoryControllerTest } ) assert_response :success - assert_equal 'application/json', response.content_type + assert_equal 'application/json', response.media_type data = ActiveSupport::JSON.decode(response.body) assert_not_nil data['labels'] assert_not_nil data['commits'] @@ -430,7 +430,7 @@ class RepositoriesControllerTest < Redmine::RepositoryControllerTest } ) assert_response :success - assert_equal 'application/json', response.content_type + assert_equal 'application/json', response.media_type data = ActiveSupport::JSON.decode(response.body) assert_not_nil data['labels'] assert_not_nil data['commits'] diff --git a/test/functional/repositories_filesystem_controller_test.rb b/test/functional/repositories_filesystem_controller_test.rb index f502ab8d2..4fe719016 100644 --- a/test/functional/repositories_filesystem_controller_test.rb +++ b/test/functional/repositories_filesystem_controller_test.rb @@ -95,7 +95,7 @@ class RepositoriesFilesystemControllerTest < Redmine::RepositoryControllerTest :path => repository_path_hash(['test'])[:param] } assert_response :success - assert_equal 'application/octet-stream', @response.content_type + assert_equal 'application/octet-stream', @response.media_type end def test_show_non_ascii_contents @@ -138,7 +138,7 @@ class RepositoriesFilesystemControllerTest < Redmine::RepositoryControllerTest :path => repository_path_hash(['japanese', 'big-file.txt'])[:param] } assert_response :success - assert_equal 'text/html', @response.content_type + assert_equal 'text/html', @response.media_type assert_select 'p.nodata' end end diff --git a/test/functional/repositories_subversion_controller_test.rb b/test/functional/repositories_subversion_controller_test.rb index 027e21fad..30fcf2064 100644 --- a/test/functional/repositories_subversion_controller_test.rb +++ b/test/functional/repositories_subversion_controller_test.rb @@ -249,7 +249,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest } ) assert_response :success - assert_equal 'text/html', @response.content_type + assert_equal 'text/html', @response.media_type assert_select 'p.nodata' end end @@ -470,7 +470,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest } ) assert_response :success - assert_equal 'text/x-patch', @response.content_type + assert_equal 'text/x-patch', @response.media_type assert_equal 'Index: subversion_test/folder/greeter.rb', @response.body.split(/\r?\n/).first end diff --git a/test/functional/sys_controller_test.rb b/test/functional/sys_controller_test.rb index 3afdffb21..352903c9a 100644 --- a/test/functional/sys_controller_test.rb +++ b/test/functional/sys_controller_test.rb @@ -34,7 +34,7 @@ class SysControllerTest < Redmine::ControllerTest def test_projects_with_repository_enabled get :projects assert_response :success - assert_equal 'application/json', @response.content_type + assert_equal 'application/json', @response.media_type data = ActiveSupport::JSON.decode(response.body) @@ -56,7 +56,7 @@ class SysControllerTest < Redmine::ControllerTest :repository => { :url => 'file:///create/project/repository/subproject2'} } assert_response :created - assert_equal 'application/json', @response.content_type + assert_equal 'application/json', @response.media_type r = Project.find(4).repository assert r.is_a?(Repository::Subversion) diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb index 6c69f6f9f..3c14e8e7b 100644 --- a/test/functional/timelog_controller_test.rb +++ b/test/functional/timelog_controller_test.rb @@ -1341,7 +1341,7 @@ class TimelogControllerTest < Redmine::ControllerTest def test_index_atom_feed get :index, :params => {:project_id => 1, :format => 'atom'} assert_response :success - assert_equal 'application/atom+xml', @response.content_type + assert_equal 'application/atom+xml', @response.media_type assert_select 'entry > title', :text => /7\.65 hours/ end diff --git a/test/functional/versions_controller_test.rb b/test/functional/versions_controller_test.rb index 44c683d7a..b298153bc 100644 --- a/test/functional/versions_controller_test.rb +++ b/test/functional/versions_controller_test.rb @@ -228,7 +228,7 @@ class VersionsControllerTest < Redmine::ControllerTest @request.session[:user_id] = 2 get :new, :params => {:project_id => '1'}, :xhr => true assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end def test_create @@ -252,7 +252,7 @@ class VersionsControllerTest < Redmine::ControllerTest assert_equal 1, version.project_id assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type assert_include 'test_add_version_from_issue_form', response.body end @@ -262,7 +262,7 @@ class VersionsControllerTest < Redmine::ControllerTest post :create, :params => {:project_id => '1', :version => {:name => ''}}, :xhr => true end assert_response :success - assert_equal 'text/javascript', response.content_type + assert_equal 'text/javascript', response.media_type end def test_get_edit diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index bb76f51e8..219d13317 100644 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -1009,7 +1009,7 @@ class WikiControllerTest < Redmine::ControllerTest get :export, :params => {:project_id => 'ecookbook'} assert_response :success - assert_equal "text/html", @response.content_type + assert_equal "text/html", @response.media_type assert_select "a[name=?]", "CookBook_documentation" assert_select "a[name=?]", "Another_page" @@ -1021,7 +1021,7 @@ class WikiControllerTest < Redmine::ControllerTest get :export, :params => {:project_id => 'ecookbook', :format => 'pdf'} assert_response :success - assert_equal 'application/pdf', @response.content_type + assert_equal 'application/pdf', @response.media_type assert_equal 'attachment; filename="ecookbook.pdf"', @response.headers['Content-Disposition'] assert @response.body.starts_with?('%PDF') end @@ -1086,7 +1086,7 @@ class WikiControllerTest < Redmine::ControllerTest get :show, :params => {:project_id => 1, :format => 'pdf'} assert_response :success - assert_equal 'application/pdf', @response.content_type + assert_equal 'application/pdf', @response.media_type assert_equal 'attachment; filename="CookBook_documentation.pdf"', @response.headers['Content-Disposition'] end @@ -1096,7 +1096,7 @@ class WikiControllerTest < Redmine::ControllerTest get :show, :params => {:project_id => 1, :format => 'html'} assert_response :success - assert_equal 'text/html', @response.content_type + assert_equal 'text/html', @response.media_type assert_equal 'attachment; filename="CookBook_documentation.html"', @response.headers['Content-Disposition'] assert_select 'h1', :text => /CookBook documentation/ @@ -1107,7 +1107,7 @@ class WikiControllerTest < Redmine::ControllerTest get :show, :params => {:project_id => 1, :format => 'html', :version => 2} assert_response :success - assert_equal 'text/html', @response.content_type + assert_equal 'text/html', @response.media_type assert_equal 'attachment; filename="CookBook_documentation.html"', @response.headers['Content-Disposition'] assert_select 'h1', :text => /CookBook documentation v2/ @@ -1118,7 +1118,7 @@ class WikiControllerTest < Redmine::ControllerTest get :show, :params => {:project_id => 1, :format => 'txt'} assert_response :success - assert_equal 'text/plain', @response.content_type + assert_equal 'text/plain', @response.media_type assert_equal 'attachment; filename="CookBook_documentation.txt"', @response.headers['Content-Disposition'] assert_include 'h1. CookBook documentation', @response.body @@ -1129,7 +1129,7 @@ class WikiControllerTest < Redmine::ControllerTest get :show, :params => {:project_id => 1, :format => 'txt', :version => 2} assert_response :success - assert_equal 'text/plain', @response.content_type + assert_equal 'text/plain', @response.media_type assert_equal 'attachment; filename="CookBook_documentation.txt"', @response.headers['Content-Disposition'] assert_include 'h1. CookBook documentation v2', @response.body |