]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/traces_controller_test.rb
Merge remote-tracking branch 'upstream/pull/2433'
[rails.git] / test / controllers / traces_controller_test.rb
index 84469437ac8524b7be304df60073430fed9f5642..84a6557946eb598d6be0e1a1d2de212bfbd32148 100644 (file)
@@ -2,23 +2,9 @@ require "test_helper"
 require "minitest/mock"
 
 class TracesControllerTest < ActionController::TestCase
 require "minitest/mock"
 
 class TracesControllerTest < ActionController::TestCase
-  def setup
-    @gpx_trace_dir = Object.send("remove_const", "GPX_TRACE_DIR")
-    Object.const_set("GPX_TRACE_DIR", Rails.root.join("test", "gpx", "traces"))
-
-    @gpx_image_dir = Object.send("remove_const", "GPX_IMAGE_DIR")
-    Object.const_set("GPX_IMAGE_DIR", Rails.root.join("test", "gpx", "images"))
-  end
-
   def teardown
   def teardown
-    File.unlink(*Dir.glob(File.join(GPX_TRACE_DIR, "*.gpx")))
-    File.unlink(*Dir.glob(File.join(GPX_IMAGE_DIR, "*.gif")))
-
-    Object.send("remove_const", "GPX_TRACE_DIR")
-    Object.const_set("GPX_TRACE_DIR", @gpx_trace_dir)
-
-    Object.send("remove_const", "GPX_IMAGE_DIR")
-    Object.const_set("GPX_IMAGE_DIR", @gpx_image_dir)
+    File.unlink(*Dir.glob(File.join(Settings.gpx_trace_dir, "*.gpx")))
+    File.unlink(*Dir.glob(File.join(Settings.gpx_image_dir, "*.gif")))
   end
 
   ##
   end
 
   ##
@@ -402,7 +388,7 @@ class TracesControllerTest < ActionController::TestCase
 
     # And finally we should be able to do it with the owner of the trace
     get :data, :params => { :display_name => anon_trace_file.user.display_name, :id => anon_trace_file.id }, :session => { :user => anon_trace_file.user }
 
     # And finally we should be able to do it with the owner of the trace
     get :data, :params => { :display_name => anon_trace_file.user.display_name, :id => anon_trace_file.id }, :session => { :user => anon_trace_file.user }
-    check_trace_data anon_trace_file, "66179ca44f1e93d8df62e2b88cbea732"
+    check_trace_data anon_trace_file, "db4cb5ed2d7d2b627b3b504296c4f701"
   end
 
   # Test downloading a trace that doesn't exist
   end
 
   # Test downloading a trace that doesn't exist