]> git.openstreetmap.org Git - rails.git/commitdiff
Fix some deprecation warnings
authorTom Hughes <tom@compton.nu>
Wed, 4 Sep 2019 13:45:46 +0000 (14:45 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 24 Nov 2019 11:05:02 +0000 (11:05 +0000)
app/mailers/notifier.rb
lib/redactable.rb
test/controllers/api/notes_controller_test.rb
test/controllers/api/traces_controller_test.rb
test/controllers/api/user_preferences_controller_test.rb
test/controllers/api/users_controller_test.rb
test/controllers/changeset_comments_controller_test.rb
test/controllers/changesets_controller_test.rb
test/controllers/traces_controller_test.rb
test/integration/cors_test.rb

index 4509f10114bec03308da57e7744426389caf1a1b..6e0c81a39177337b6f6ad57ddeb6b2d11e36644a 100644 (file)
@@ -1,6 +1,8 @@
 class Notifier < ActionMailer::Base
   include ActionView::Helpers::AssetUrlHelper
 
 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"
   default :from => Settings.email_from,
           :return_path => Settings.email_return_path,
           :auto_submitted => "auto-generated"
index d827cfd7462aa318a11c4754434ccd311dab4a7f..6efdae0efd4b2dfeb8bf91c3969c88af54df8594 100644 (file)
@@ -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.
   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?
   end
 
   def redacted?
index 54a20028de33846cfee627ca23769708d280e9b0..2557a353b1a9d25b7cb46794cd12060a9bdaa845 100644 (file)
@@ -479,7 +479,7 @@ module Api
 
       get :show, :params => { :id => open_note.id, :format => "xml" }
       assert_response :success
 
       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
       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
 
       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
       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
 
       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"]
       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
 
       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
       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
 
       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
       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
 
       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"]
       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
 
       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_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
       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
 
       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
       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
 
       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"]
       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
 
       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_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
       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
     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
       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
 
       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"]
       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
 
       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_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
       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
     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
 
       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
 
       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
 
       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
     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
       # 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"]
       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
       # 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"]
       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
       # 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"]
       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
 
       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_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"]
       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
 
       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
       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
 
       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
       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
 
       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_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"]
       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
 
       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
       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
 
       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
       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
 
       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_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"]
       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
 
       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
       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
 
       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
       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
 
       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_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"]
       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
 
       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
       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
 
       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
       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
 
       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_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"]
       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
 
       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
       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
 
       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
       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
 
       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
       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
 
       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
       assert_select "rss", :count => 1 do
         assert_select "channel", :count => 1 do
           assert_select "item", :count => 2
index cc191c08359a3e7a1b32e2684898714f2f54989e..80b9d1a8458a445e2719c2059a8c2eefe72d49d9 100644 (file)
@@ -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)
     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
 
       assert_equal "attachment; filename=\"#{trace.id}.#{extension}\"; filename*=UTF-8''#{trace.id}.#{extension}", @response.header["Content-Disposition"]
     end
 
index ac377848c9332d5afe66df800219059c8041db8e..3223eb5ddf29fa3b725195af64930d02ae481d81 100644 (file)
@@ -54,7 +54,7 @@ module Api
       # try the read again
       get :index
       assert_response :success
       # 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
       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
       # 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
       assert_equal "value", @response.body
 
       # try the read again for a non-existent key
@@ -114,7 +114,7 @@ module Api
         put :update_all, :body => "<osm><preferences><preference k='key' v='new_value'/><preference k='new_key' v='value'/></preferences></osm>"
       end
       assert_response :success
         put :update_all, :body => "<osm><preferences><preference k='key' v='new_value'/><preference k='new_key' v='value'/></preferences></osm>"
       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
       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 => "<osm><preferences><preference k='key' v='value'/><preference k='key' v='newer_value'/></preferences></osm>"
       end
       assert_response :bad_request
         put :update_all, :body => "<osm><preferences><preference k='key' v='value'/><preference k='key' v='newer_value'/></preferences></osm>"
       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
 
       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
         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
 
       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
         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
       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
         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"])
       assert_equal "", @response.body
       assert_raises ActiveRecord::RecordNotFound do
         UserPreference.find([user.id, "key"])
index de402ebf8ea80080c6c1fe8bdbcbd44d98fb5b0b..cc9d932bcb3e705b726a19e1a5a276bd572cdf1e 100644 (file)
@@ -34,7 +34,7 @@ module Api
       # check that a visible user is returned properly
       get :show, :params => { :id => user.id }
       assert_response :success
       # 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"
 
       # 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
       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"
 
       # 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
 
       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
       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
 
       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
       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
 
       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
       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
       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
 
       # check the data that is returned
       assert_select "gpx_file[id='#{trace1.id}']", 1 do
index 2d13bd92bbbc614d1ecd6d9d267569d234c0167d..a1a00c5dc7d70f09314cbe2998668a9fc71d17c4 100644 (file)
@@ -22,7 +22,7 @@ class ChangesetCommentsControllerTest < ActionController::TestCase
 
     get :index, :params => { :format => "rss" }
     assert_response :success
 
     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
     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
 
     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
     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
 
     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
     assert_select "rss", :count => 1 do
       assert_select "channel", :count => 1 do
         assert_select "item", :count => 3
index caf7721cd4ab425e483e7720f9147fc62cc41450..e754e32b71dac1ed67829c099b98596cf0f61c3f 100644 (file)
@@ -214,7 +214,7 @@ class ChangesetsControllerTest < ActionController::TestCase
     get :feed, :params => { :format => :atom }
     assert_response :success
     assert_template "index"
     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
 
     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"
     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
 
     check_feed_result([changeset, closed_changeset])
   end
@@ -250,7 +250,7 @@ class ChangesetsControllerTest < ActionController::TestCase
 
     assert_response :success
     assert_template "index"
 
     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
 
     check_feed_result(changesets)
   end
index c27d3c3db420920da1d3552f9a359c4e9b9ac439..45b0358f5f957538ff2bd0b77ade2cf0a088810a 100644 (file)
@@ -681,7 +681,7 @@ class TracesControllerTest < ActionController::TestCase
   def check_trace_feed(traces)
     assert_response :success
     assert_template "georss"
   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"
     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)
   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 "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 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
     assert_equal trace.icon_picture, response.body
   end
 end
index 82e8346469cff7828e221fff90faada2164a8e12..c35f73d349d7c90f415d73c6e7935feabafeb8c2 100644 (file)
@@ -9,7 +9,7 @@ class CORSTest < ActionDispatch::IntegrationTest
 
     assert_response :success
     assert_equal "*", response.headers["Access-Control-Allow-Origin"]
 
     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
 
     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_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
     assert_equal "", response.body
   end
 end