X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c51786d10bc6dda488964f468a6a3071dd6912a8..ef85e8c7b346588a5e6ad0df7ddeb1046977c61a:/test/models/trace_test.rb diff --git a/test/models/trace_test.rb b/test/models/trace_test.rb index bf4e0196b..9682d6b28 100644 --- a/test/models/trace_test.rb +++ b/test/models/trace_test.rb @@ -76,17 +76,17 @@ class TraceTest < ActiveSupport::TestCase def test_validations trace_valid({}) - trace_valid({ :user_id => nil }, false) - trace_valid(:name => "a" * 255) - trace_valid({ :name => "a" * 256 }, false) - trace_valid({ :description => nil }, false) - trace_valid(:description => "a" * 255) - trace_valid({ :description => "a" * 256 }, false) - trace_valid(:visibility => "private") - trace_valid(:visibility => "public") - trace_valid(:visibility => "trackable") - trace_valid(:visibility => "identifiable") - trace_valid({ :visibility => "foo" }, false) + trace_valid({ :user_id => nil }, :valid => false) + trace_valid({ :name => "a" * 255 }) + trace_valid({ :name => "a" * 256 }, :valid => false) + trace_valid({ :description => nil }, :valid => false) + trace_valid({ :description => "a" * 255 }) + trace_valid({ :description => "a" * 256 }, :valid => false) + trace_valid({ :visibility => "private" }) + trace_valid({ :visibility => "public" }) + trace_valid({ :visibility => "trackable" }) + trace_valid({ :visibility => "identifiable" }) + trace_valid({ :visibility => "foo" }, :valid => false) end def test_tagstring @@ -222,7 +222,7 @@ class TraceTest < ActiveSupport::TestCase trace.import - assert File.exist?(icon_path) + assert_path_exists(icon_path) end def test_import_creates_large_picture @@ -233,7 +233,7 @@ class TraceTest < ActiveSupport::TestCase trace.import - assert File.exist?(large_picture_path) + assert_path_exists(large_picture_path) end def test_import_handles_bz2 @@ -319,9 +319,9 @@ class TraceTest < ActiveSupport::TestCase assert_equal md5sum, md5sum(create(:trace, :fixture => id).xml_file) end - def trace_valid(attrs, result = true) + def trace_valid(attrs, valid: true) entry = build(:trace, attrs) - assert_equal result, entry.valid?, "Expected #{attrs.inspect} to be #{result}" + assert_equal valid, entry.valid?, "Expected #{attrs.inspect} to be #{valid}" end def md5sum(io)