From: Tom Hughes Date: Wed, 4 Sep 2019 13:45:46 +0000 (+0100) Subject: Fix some deprecation warnings X-Git-Tag: live~2950^2~1 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/1f4d48eaf35f5e26909cf7b63ab72c77420546b1?hp=22cd2314e52373d8fbe84a082c3ed058dfea8d40 Fix some deprecation warnings --- diff --git a/app/mailers/notifier.rb b/app/mailers/notifier.rb index 4509f1011..6e0c81a39 100644 --- a/app/mailers/notifier.rb +++ b/app/mailers/notifier.rb @@ -1,6 +1,8 @@ class Notifier < ActionMailer::Base include ActionView::Helpers::AssetUrlHelper + self.delivery_job = ActionMailer::MailDeliveryJob + default :from => Settings.email_from, :return_path => Settings.email_return_path, :auto_submitted => "auto-generated" diff --git a/lib/redactable.rb b/lib/redactable.rb index d827cfd74..6efdae0ef 100644 --- a/lib/redactable.rb +++ b/lib/redactable.rb @@ -4,7 +4,7 @@ module Redactable def self.included(base) # this is used to extend activerecord bases, as these aren't # in scope for the module itself. - base.scope :unredacted, -> { base.where(:redaction_id => nil) } + base.scope :unredacted, -> { where(:redaction_id => nil) } end def redacted? diff --git a/test/controllers/api/notes_controller_test.rb b/test/controllers/api/notes_controller_test.rb index 54a20028d..2557a353b 100644 --- a/test/controllers/api/notes_controller_test.rb +++ b/test/controllers/api/notes_controller_test.rb @@ -479,7 +479,7 @@ module Api get :show, :params => { :id => open_note.id, :format => "xml" } assert_response :success - assert_equal "application/xml", @response.content_type + assert_equal "application/xml", @response.media_type assert_select "osm", :count => 1 do assert_select "note[lat='#{open_note.lat}'][lon='#{open_note.lon}']", :count => 1 do assert_select "id", open_note.id.to_s @@ -496,7 +496,7 @@ module Api get :show, :params => { :id => open_note.id, :format => "rss" } assert_response :success - assert_equal "application/rss+xml", @response.content_type + assert_equal "application/rss+xml", @response.media_type assert_select "rss", :count => 1 do assert_select "channel", :count => 1 do assert_select "item", :count => 1 do @@ -512,7 +512,7 @@ module Api get :show, :params => { :id => open_note.id, :format => "json" } assert_response :success - assert_equal "application/json", @response.content_type + assert_equal "application/json", @response.media_type js = ActiveSupport::JSON.decode(@response.body) assert_not_nil js assert_equal "Feature", js["type"] @@ -528,7 +528,7 @@ module Api get :show, :params => { :id => open_note.id, :format => "gpx" } assert_response :success - assert_equal "application/gpx+xml", @response.content_type + assert_equal "application/gpx+xml", @response.media_type assert_select "gpx", :count => 1 do assert_select "wpt[lat='#{open_note.lat}'][lon='#{open_note.lon}']", :count => 1 do assert_select "time", :count => 1 @@ -636,7 +636,7 @@ module Api get :index, :params => { :bbox => "1,1,1.2,1.2", :format => "rss" } assert_response :success - assert_equal "application/rss+xml", @response.content_type + assert_equal "application/rss+xml", @response.media_type assert_select "rss", :count => 1 do assert_select "channel", :count => 1 do assert_select "item", :count => 2 @@ -645,7 +645,7 @@ module Api get :index, :params => { :bbox => "1,1,1.2,1.2", :format => "json" } assert_response :success - assert_equal "application/json", @response.content_type + assert_equal "application/json", @response.media_type js = ActiveSupport::JSON.decode(@response.body) assert_not_nil js assert_equal "FeatureCollection", js["type"] @@ -653,14 +653,14 @@ module Api get :index, :params => { :bbox => "1,1,1.2,1.2", :format => "xml" } assert_response :success - assert_equal "application/xml", @response.content_type + assert_equal "application/xml", @response.media_type assert_select "osm", :count => 1 do assert_select "note", :count => 2 end get :index, :params => { :bbox => "1,1,1.2,1.2", :format => "gpx" } assert_response :success - assert_equal "application/gpx+xml", @response.content_type + assert_equal "application/gpx+xml", @response.media_type assert_select "gpx", :count => 1 do assert_select "wpt", :count => 2 end @@ -673,7 +673,7 @@ module Api get :index, :params => { :bbox => "1,1,1.2,1.2", :limit => 1, :format => "rss" } assert_response :success - assert_equal "application/rss+xml", @response.content_type + assert_equal "application/rss+xml", @response.media_type assert_select "rss", :count => 1 do assert_select "channel", :count => 1 do assert_select "item", :count => 1 @@ -682,7 +682,7 @@ module Api get :index, :params => { :bbox => "1,1,1.2,1.2", :limit => 1, :format => "json" } assert_response :success - assert_equal "application/json", @response.content_type + assert_equal "application/json", @response.media_type js = ActiveSupport::JSON.decode(@response.body) assert_not_nil js assert_equal "FeatureCollection", js["type"] @@ -690,14 +690,14 @@ module Api get :index, :params => { :bbox => "1,1,1.2,1.2", :limit => 1, :format => "xml" } assert_response :success - assert_equal "application/xml", @response.content_type + assert_equal "application/xml", @response.media_type assert_select "osm", :count => 1 do assert_select "note", :count => 1 end get :index, :params => { :bbox => "1,1,1.2,1.2", :limit => 1, :format => "gpx" } assert_response :success - assert_equal "application/gpx+xml", @response.content_type + assert_equal "application/gpx+xml", @response.media_type assert_select "gpx", :count => 1 do assert_select "wpt", :count => 1 end @@ -706,7 +706,7 @@ module Api def test_index_empty_area get :index, :params => { :bbox => "5,5,5.1,5.1", :format => "rss" } assert_response :success - assert_equal "application/rss+xml", @response.content_type + assert_equal "application/rss+xml", @response.media_type assert_select "rss", :count => 1 do assert_select "channel", :count => 1 do assert_select "item", :count => 0 @@ -715,7 +715,7 @@ module Api get :index, :params => { :bbox => "5,5,5.1,5.1", :format => "json" } assert_response :success - assert_equal "application/json", @response.content_type + assert_equal "application/json", @response.media_type js = ActiveSupport::JSON.decode(@response.body) assert_not_nil js assert_equal "FeatureCollection", js["type"] @@ -723,14 +723,14 @@ module Api get :index, :params => { :bbox => "5,5,5.1,5.1", :format => "xml" } assert_response :success - assert_equal "application/xml", @response.content_type + assert_equal "application/xml", @response.media_type assert_select "osm", :count => 1 do assert_select "note", :count => 0 end get :index, :params => { :bbox => "5,5,5.1,5.1", :format => "gpx" } assert_response :success - assert_equal "application/gpx+xml", @response.content_type + assert_equal "application/gpx+xml", @response.media_type assert_select "gpx", :count => 1 do assert_select "wpt", :count => 0 end @@ -739,19 +739,19 @@ module Api def test_index_large_area get :index, :params => { :bbox => "-2.5,-2.5,2.5,2.5", :format => :json } assert_response :success - assert_equal "application/json", @response.content_type + assert_equal "application/json", @response.media_type get :index, :params => { :l => "-2.5", :b => "-2.5", :r => "2.5", :t => "2.5", :format => :json } assert_response :success - assert_equal "application/json", @response.content_type + assert_equal "application/json", @response.media_type get :index, :params => { :bbox => "-10,-10,12,12", :format => :json } assert_response :bad_request - assert_equal "application/json", @response.content_type + assert_equal "application/json", @response.media_type get :index, :params => { :l => "-10", :b => "-10", :r => "12", :t => "12", :format => :json } assert_response :bad_request - assert_equal "application/json", @response.content_type + assert_equal "application/json", @response.media_type end def test_index_closed @@ -763,7 +763,7 @@ module Api # Open notes + closed in last 7 days get :index, :params => { :bbox => "1,1,1.7,1.7", :closed => "7", :format => "json" } assert_response :success - assert_equal "application/json", @response.content_type + assert_equal "application/json", @response.media_type js = ActiveSupport::JSON.decode(@response.body) assert_not_nil js assert_equal "FeatureCollection", js["type"] @@ -772,7 +772,7 @@ module Api # Only open notes get :index, :params => { :bbox => "1,1,1.7,1.7", :closed => "0", :format => "json" } assert_response :success - assert_equal "application/json", @response.content_type + assert_equal "application/json", @response.media_type js = ActiveSupport::JSON.decode(@response.body) assert_not_nil js assert_equal "FeatureCollection", js["type"] @@ -781,7 +781,7 @@ module Api # Open notes + all closed notes get :index, :params => { :bbox => "1,1,1.7,1.7", :closed => "-1", :format => "json" } assert_response :success - assert_equal "application/json", @response.content_type + assert_equal "application/json", @response.media_type js = ActiveSupport::JSON.decode(@response.body) assert_not_nil js assert_equal "FeatureCollection", js["type"] @@ -819,14 +819,14 @@ module Api get :search, :params => { :q => "note comment", :format => "xml" } assert_response :success - assert_equal "application/xml", @response.content_type + assert_equal "application/xml", @response.media_type assert_select "osm", :count => 1 do assert_select "note", :count => 1 end get :search, :params => { :q => "note comment", :format => "json" } assert_response :success - assert_equal "application/json", @response.content_type + assert_equal "application/json", @response.media_type js = ActiveSupport::JSON.decode(@response.body) assert_not_nil js assert_equal "FeatureCollection", js["type"] @@ -834,7 +834,7 @@ module Api get :search, :params => { :q => "note comment", :format => "rss" } assert_response :success - assert_equal "application/rss+xml", @response.content_type + assert_equal "application/rss+xml", @response.media_type assert_select "rss", :count => 1 do assert_select "channel", :count => 1 do assert_select "item", :count => 1 @@ -843,7 +843,7 @@ module Api get :search, :params => { :q => "note comment", :format => "gpx" } assert_response :success - assert_equal "application/gpx+xml", @response.content_type + assert_equal "application/gpx+xml", @response.media_type assert_select "gpx", :count => 1 do assert_select "wpt", :count => 1 end @@ -858,14 +858,14 @@ module Api get :search, :params => { :display_name => user.display_name, :format => "xml" } assert_response :success - assert_equal "application/xml", @response.content_type + assert_equal "application/xml", @response.media_type assert_select "osm", :count => 1 do assert_select "note", :count => 1 end get :search, :params => { :display_name => user.display_name, :format => "json" } assert_response :success - assert_equal "application/json", @response.content_type + assert_equal "application/json", @response.media_type js = ActiveSupport::JSON.decode(@response.body) assert_not_nil js assert_equal "FeatureCollection", js["type"] @@ -873,7 +873,7 @@ module Api get :search, :params => { :display_name => user.display_name, :format => "rss" } assert_response :success - assert_equal "application/rss+xml", @response.content_type + assert_equal "application/rss+xml", @response.media_type assert_select "rss", :count => 1 do assert_select "channel", :count => 1 do assert_select "item", :count => 1 @@ -882,7 +882,7 @@ module Api get :search, :params => { :display_name => user.display_name, :format => "gpx" } assert_response :success - assert_equal "application/gpx+xml", @response.content_type + assert_equal "application/gpx+xml", @response.media_type assert_select "gpx", :count => 1 do assert_select "wpt", :count => 1 end @@ -897,14 +897,14 @@ module Api get :search, :params => { :user => user.id, :format => "xml" } assert_response :success - assert_equal "application/xml", @response.content_type + assert_equal "application/xml", @response.media_type assert_select "osm", :count => 1 do assert_select "note", :count => 1 end get :search, :params => { :user => user.id, :format => "json" } assert_response :success - assert_equal "application/json", @response.content_type + assert_equal "application/json", @response.media_type js = ActiveSupport::JSON.decode(@response.body) assert_not_nil js assert_equal "FeatureCollection", js["type"] @@ -912,7 +912,7 @@ module Api get :search, :params => { :user => user.id, :format => "rss" } assert_response :success - assert_equal "application/rss+xml", @response.content_type + assert_equal "application/rss+xml", @response.media_type assert_select "rss", :count => 1 do assert_select "channel", :count => 1 do assert_select "item", :count => 1 @@ -921,7 +921,7 @@ module Api get :search, :params => { :user => user.id, :format => "gpx" } assert_response :success - assert_equal "application/gpx+xml", @response.content_type + assert_equal "application/gpx+xml", @response.media_type assert_select "gpx", :count => 1 do assert_select "wpt", :count => 1 end @@ -932,14 +932,14 @@ module Api get :search, :params => { :q => "no match", :format => "xml" } assert_response :success - assert_equal "application/xml", @response.content_type + assert_equal "application/xml", @response.media_type assert_select "osm", :count => 1 do assert_select "note", :count => 0 end get :search, :params => { :q => "no match", :format => "json" } assert_response :success - assert_equal "application/json", @response.content_type + assert_equal "application/json", @response.media_type js = ActiveSupport::JSON.decode(@response.body) assert_not_nil js assert_equal "FeatureCollection", js["type"] @@ -947,7 +947,7 @@ module Api get :search, :params => { :q => "no match", :format => "rss" } assert_response :success - assert_equal "application/rss+xml", @response.content_type + assert_equal "application/rss+xml", @response.media_type assert_select "rss", :count => 1 do assert_select "channel", :count => 1 do assert_select "item", :count => 0 @@ -956,7 +956,7 @@ module Api get :search, :params => { :q => "no match", :format => "gpx" } assert_response :success - assert_equal "application/gpx+xml", @response.content_type + assert_equal "application/gpx+xml", @response.media_type assert_select "gpx", :count => 1 do assert_select "wpt", :count => 0 end @@ -967,14 +967,14 @@ module Api get :search, :params => { :from => "01.01.2010", :to => "01.10.2010", :format => "xml" } assert_response :success - assert_equal "application/xml", @response.content_type + assert_equal "application/xml", @response.media_type assert_select "osm", :count => 1 do assert_select "note", :count => 0 end get :search, :params => { :from => "01.01.2010", :to => "01.10.2010", :format => "json" } assert_response :success - assert_equal "application/json", @response.content_type + assert_equal "application/json", @response.media_type js = ActiveSupport::JSON.decode(@response.body) assert_not_nil js assert_equal "FeatureCollection", js["type"] @@ -982,7 +982,7 @@ module Api get :search, :params => { :from => "01.01.2010", :to => "01.10.2010", :format => "rss" } assert_response :success - assert_equal "application/rss+xml", @response.content_type + assert_equal "application/rss+xml", @response.media_type assert_select "rss", :count => 1 do assert_select "channel", :count => 1 do assert_select "item", :count => 0 @@ -991,7 +991,7 @@ module Api get :search, :params => { :from => "01.01.2010", :to => "01.10.2010", :format => "gpx" } assert_response :success - assert_equal "application/gpx+xml", @response.content_type + assert_equal "application/gpx+xml", @response.media_type assert_select "gpx", :count => 1 do assert_select "wpt", :count => 0 end @@ -1027,7 +1027,7 @@ module Api get :feed, :params => { :format => "rss" } assert_response :success - assert_equal "application/rss+xml", @response.content_type + assert_equal "application/rss+xml", @response.media_type assert_select "rss", :count => 1 do assert_select "channel", :count => 1 do assert_select "item", :count => 4 @@ -1036,7 +1036,7 @@ module Api get :feed, :params => { :bbox => "1,1,1.2,1.2", :format => "rss" } assert_response :success - assert_equal "application/rss+xml", @response.content_type + assert_equal "application/rss+xml", @response.media_type assert_select "rss", :count => 1 do assert_select "channel", :count => 1 do assert_select "item", :count => 2 diff --git a/test/controllers/api/traces_controller_test.rb b/test/controllers/api/traces_controller_test.rb index cc191c083..80b9d1a84 100644 --- a/test/controllers/api/traces_controller_test.rb +++ b/test/controllers/api/traces_controller_test.rb @@ -336,7 +336,7 @@ module Api def check_trace_data(trace, digest, content_type = "application/gpx+xml", extension = "gpx") assert_response :success assert_equal digest, Digest::MD5.hexdigest(response.body) - assert_equal content_type, response.content_type + assert_equal content_type, response.media_type assert_equal "attachment; filename=\"#{trace.id}.#{extension}\"; filename*=UTF-8''#{trace.id}.#{extension}", @response.header["Content-Disposition"] end diff --git a/test/controllers/api/user_preferences_controller_test.rb b/test/controllers/api/user_preferences_controller_test.rb index ac377848c..3223eb5dd 100644 --- a/test/controllers/api/user_preferences_controller_test.rb +++ b/test/controllers/api/user_preferences_controller_test.rb @@ -54,7 +54,7 @@ module Api # try the read again get :index assert_response :success - assert_equal "application/xml", @response.content_type + assert_equal "application/xml", @response.media_type assert_select "osm" do assert_select "preferences", :count => 1 do assert_select "preference", :count => 2 @@ -80,7 +80,7 @@ module Api # try the read again get :show, :params => { :preference_key => "key" } assert_response :success - assert_equal "text/plain", @response.content_type + assert_equal "text/plain", @response.media_type assert_equal "value", @response.body # try the read again for a non-existent key @@ -114,7 +114,7 @@ module Api put :update_all, :body => "" end assert_response :success - assert_equal "text/plain", @response.content_type + assert_equal "text/plain", @response.media_type assert_equal "", @response.body assert_equal "new_value", UserPreference.find([user.id, "key"]).v assert_equal "value", UserPreference.find([user.id, "new_key"]).v @@ -127,7 +127,7 @@ module Api put :update_all, :body => "" end assert_response :bad_request - assert_equal "text/plain", @response.content_type + assert_equal "text/plain", @response.media_type assert_equal "Duplicate preferences with key key", @response.body assert_equal "new_value", UserPreference.find([user.id, "key"]).v @@ -161,7 +161,7 @@ module Api put :update, :params => { :preference_key => "new_key" }, :body => "new_value" end assert_response :success - assert_equal "text/plain", @response.content_type + assert_equal "text/plain", @response.media_type assert_equal "", @response.body assert_equal "new_value", UserPreference.find([user.id, "new_key"]).v @@ -170,7 +170,7 @@ module Api put :update, :params => { :preference_key => "new_key" }, :body => "newer_value" end assert_response :success - assert_equal "text/plain", @response.content_type + assert_equal "text/plain", @response.media_type assert_equal "", @response.body assert_equal "newer_value", UserPreference.find([user.id, "new_key"]).v end @@ -196,7 +196,7 @@ module Api get :destroy, :params => { :preference_key => "key" } end assert_response :success - assert_equal "text/plain", @response.content_type + assert_equal "text/plain", @response.media_type assert_equal "", @response.body assert_raises ActiveRecord::RecordNotFound do UserPreference.find([user.id, "key"]) diff --git a/test/controllers/api/users_controller_test.rb b/test/controllers/api/users_controller_test.rb index de402ebf8..cc9d932bc 100644 --- a/test/controllers/api/users_controller_test.rb +++ b/test/controllers/api/users_controller_test.rb @@ -34,7 +34,7 @@ module Api # check that a visible user is returned properly get :show, :params => { :id => user.id } assert_response :success - assert_equal "text/xml", response.content_type + assert_equal "text/xml", response.media_type # check the data that is returned assert_select "description", :count => 1, :text => "test" @@ -90,7 +90,7 @@ module Api basic_authorization user.email, "test" get :details assert_response :success - assert_equal "text/xml", response.content_type + assert_equal "text/xml", response.media_type # check the data that is returned assert_select "description", :count => 1, :text => "test" @@ -136,7 +136,7 @@ module Api get :index, :params => { :users => user1.id } assert_response :success - assert_equal "text/xml", response.content_type + assert_equal "text/xml", response.media_type assert_select "user", :count => 1 do assert_select "user[id='#{user1.id}']", :count => 1 assert_select "user[id='#{user2.id}']", :count => 0 @@ -145,7 +145,7 @@ module Api get :index, :params => { :users => user2.id } assert_response :success - assert_equal "text/xml", response.content_type + assert_equal "text/xml", response.media_type assert_select "user", :count => 1 do assert_select "user[id='#{user1.id}']", :count => 0 assert_select "user[id='#{user2.id}']", :count => 1 @@ -154,7 +154,7 @@ module Api get :index, :params => { :users => "#{user1.id},#{user3.id}" } assert_response :success - assert_equal "text/xml", response.content_type + assert_equal "text/xml", response.media_type assert_select "user", :count => 2 do assert_select "user[id='#{user1.id}']", :count => 1 assert_select "user[id='#{user2.id}']", :count => 0 @@ -187,7 +187,7 @@ module Api basic_authorization user.email, "test" get :gpx_files assert_response :success - assert_equal "application/xml", response.content_type + assert_equal "application/xml", response.media_type # check the data that is returned assert_select "gpx_file[id='#{trace1.id}']", 1 do diff --git a/test/controllers/changeset_comments_controller_test.rb b/test/controllers/changeset_comments_controller_test.rb index 2d13bd92b..a1a00c5dc 100644 --- a/test/controllers/changeset_comments_controller_test.rb +++ b/test/controllers/changeset_comments_controller_test.rb @@ -22,7 +22,7 @@ class ChangesetCommentsControllerTest < ActionController::TestCase get :index, :params => { :format => "rss" } assert_response :success - assert_equal "application/rss+xml", @response.content_type + assert_equal "application/rss+xml", @response.media_type assert_select "rss", :count => 1 do assert_select "channel", :count => 1 do assert_select "item", :count => 3 @@ -31,7 +31,7 @@ class ChangesetCommentsControllerTest < ActionController::TestCase get :index, :params => { :format => "rss", :limit => 2 } assert_response :success - assert_equal "application/rss+xml", @response.content_type + assert_equal "application/rss+xml", @response.media_type assert_select "rss", :count => 1 do assert_select "channel", :count => 1 do assert_select "item", :count => 2 @@ -40,7 +40,7 @@ class ChangesetCommentsControllerTest < ActionController::TestCase get :index, :params => { :id => changeset.id, :format => "rss" } assert_response :success - assert_equal "application/rss+xml", @response.content_type + assert_equal "application/rss+xml", @response.media_type assert_select "rss", :count => 1 do assert_select "channel", :count => 1 do assert_select "item", :count => 3 diff --git a/test/controllers/changesets_controller_test.rb b/test/controllers/changesets_controller_test.rb index caf7721cd..e754e32b7 100644 --- a/test/controllers/changesets_controller_test.rb +++ b/test/controllers/changesets_controller_test.rb @@ -214,7 +214,7 @@ class ChangesetsControllerTest < ActionController::TestCase get :feed, :params => { :format => :atom } assert_response :success assert_template "index" - assert_equal "application/atom+xml", response.content_type + assert_equal "application/atom+xml", response.media_type check_feed_result([changeset, closed_changeset]) end @@ -232,7 +232,7 @@ class ChangesetsControllerTest < ActionController::TestCase get :feed, :params => { :format => :atom, :bbox => "4.5,4.5,5.5,5.5" } assert_response :success assert_template "index" - assert_equal "application/atom+xml", response.content_type + assert_equal "application/atom+xml", response.media_type check_feed_result([changeset, closed_changeset]) end @@ -250,7 +250,7 @@ class ChangesetsControllerTest < ActionController::TestCase assert_response :success assert_template "index" - assert_equal "application/atom+xml", response.content_type + assert_equal "application/atom+xml", response.media_type check_feed_result(changesets) end diff --git a/test/controllers/traces_controller_test.rb b/test/controllers/traces_controller_test.rb index c27d3c3db..45b0358f5 100644 --- a/test/controllers/traces_controller_test.rb +++ b/test/controllers/traces_controller_test.rb @@ -681,7 +681,7 @@ class TracesControllerTest < ActionController::TestCase def check_trace_feed(traces) assert_response :success assert_template "georss" - assert_equal "application/rss+xml", @response.content_type + assert_equal "application/rss+xml", @response.media_type assert_select "rss", :count => 1 do assert_select "channel", :count => 1 do assert_select "title" @@ -736,19 +736,19 @@ class TracesControllerTest < ActionController::TestCase def check_trace_data(trace, digest, content_type = "application/gpx+xml", extension = "gpx") assert_response :success assert_equal digest, Digest::MD5.hexdigest(response.body) - assert_equal content_type, response.content_type + assert_equal content_type, response.media_type assert_equal "attachment; filename=\"#{trace.id}.#{extension}\"; filename*=UTF-8''#{trace.id}.#{extension}", @response.header["Content-Disposition"] end def check_trace_picture(trace) assert_response :success - assert_equal "image/gif", response.content_type + assert_equal "image/gif", response.media_type assert_equal trace.large_picture, response.body end def check_trace_icon(trace) assert_response :success - assert_equal "image/gif", response.content_type + assert_equal "image/gif", response.media_type assert_equal trace.icon_picture, response.body end end diff --git a/test/integration/cors_test.rb b/test/integration/cors_test.rb index 82e834646..c35f73d34 100644 --- a/test/integration/cors_test.rb +++ b/test/integration/cors_test.rb @@ -9,7 +9,7 @@ class CORSTest < ActionDispatch::IntegrationTest assert_response :success assert_equal "*", response.headers["Access-Control-Allow-Origin"] - assert_nil response.content_type + assert_nil response.media_type assert_equal "", response.body end @@ -21,7 +21,7 @@ class CORSTest < ActionDispatch::IntegrationTest assert_response :success assert_nil response.headers["Access-Control-Allow-Origin"] - assert_nil response.content_type + assert_nil response.media_type assert_equal "", response.body end end