Add a limit on the number of points in a GPS trace

This commit is contained in:
Tom Hughes 2024-02-24 14:34:09 +00:00
parent 4c029873bb
commit 741ed58838
4 changed files with 24 additions and 2 deletions

View 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)