]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/api/traces_controller_test.rb
Move all settings to settings.yml
[rails.git] / test / controllers / api / traces_controller_test.rb
index 4f28514775d6cc9284ac95ea0ca47462d55c93da..0466ac9962ff72756daa48ed45b5ea25fc352f12 100644 (file)
@@ -3,23 +3,9 @@ require "minitest/mock"
 
 module Api
   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
-      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
 
     ##