X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/09f6b8348607e709729d9e3c8d2678a668ab50bb..0f7e775800a9d0082772d3f83db796b3f4e71180:/test/models/way_test.rb?ds=sidebyside 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