From f37ed7766572550bd563632f69ad940717fa9b90 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Mon, 27 Jan 2020 03:54:25 +0000 Subject: 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 --- test/test_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/test_helper.rb') diff --git a/test/test_helper.rb b/test/test_helper.rb index 0c1217fea..b3956e9af 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -348,7 +348,7 @@ module Redmine # Saves the generated PDF in tmp/test/pdf def save_pdf - assert_equal 'application/pdf', response.content_type + assert_equal 'application/pdf', response.media_type filename = "#{self.class.name.underscore}__#{method_name}.pdf" File.open(File.join($redmine_tmp_pdf_directory, filename), "wb") do |f| f.write response.body @@ -431,8 +431,8 @@ module Redmine # Parses the response body based on its content type def response_data - unless response.content_type.to_s =~ /^application\/(.+)/ - raise "Unexpected response type: #{response.content_type}" + unless response.media_type.to_s =~ /^application\/(.+)/ + raise "Unexpected response type: #{response.media_type}" end format = $1 -- cgit v1.2.3