X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/677af7dcc7c39d527cc8a4b43ec09815a52b6d1d..06d03c8acccfadfe7e2bf441c9fbd0044e7a2fcf:/test/models/trace_test.rb?ds=sidebyside diff --git a/test/models/trace_test.rb b/test/models/trace_test.rb index 1a2376ca8..f95ebe4c3 100644 --- a/test/models/trace_test.rb +++ b/test/models/trace_test.rb @@ -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)