]> git.openstreetmap.org Git - rails.git/blobdiff - test/models/trace_test.rb
Add validation for maximum ID passed to changesets#index
[rails.git] / test / models / trace_test.rb
index 1a2376ca87e35d063e5c6c53b2d119650f98a960..f95ebe4c320bd3dafa90de6d4ecb9cfb2633be1b 100644 (file)
@@ -289,6 +289,18 @@ class TraceTest < ActiveSupport::TestCase
     assert_equal 2, trace.size
   end
 
+  def test_import_enforces_limit
+    trace = create(:trace, :inserted => false, :fixture => "f")
+
+    with_settings(:max_trace_size => 1) do
+      assert_raise GPX::FileTooBigError do
+        trace.import
+      end
+    end
+
+    assert_not trace.inserted
+  end
+
   private
 
   def check_query(query, traces)