X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/09f6b8348607e709729d9e3c8d2678a668ab50bb..71f31bfc4c86b5daa8dc481226a56e2191a1b1fe:/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