X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/09f6b8348607e709729d9e3c8d2678a668ab50bb..a05692a3f6f0be293ff73aec04b32fcaf76f97ce:/test/models/way_test.rb diff --git a/test/models/way_test.rb b/test/models/way_test.rb index 8d662b657..36debfac0 100644 --- a/test/models/way_test.rb +++ b/test/models/way_test.rb @@ -290,4 +290,13 @@ class WayTest < ActiveSupport::TestCase way.update_from(new_way, user) end end + + test "raises id precondition exception when deleting" do + user = create(:user) + way = Way.new(:id => 23, :visible => true) + new_way = Way.new(:id => 42, :visible => false) + assert_raises OSM::APIPreconditionFailedError do + way.delete_with_history!(new_way, user) + end + end end